D&D is really a framework, but it does pull from all speculative fiction genres at some point, even science fiction. But, because it's a roleplay framework, experiences vary greatly depending on who is playing. In pen-and-paper versions, when a new group gathers, a common discussion is to talk about which of the thousands of rules to discard and which we absolutely think are vital. (You end up keeping most of them, or it's really just a very fun table read).
Dungeons and Dragons Online, for instance, is filled to the brim with illithids, and you'll run into some of the same canonical characters there as you do in Baldur's Gate 3, but the tone is much different.
One of the fun things about D&D is how you can sort of Terry Pratchett-ize fantasy to turn it into a semblance of technology. Like, for example,
. And the strange mixture of gravitas and extreme silliness inherent in fighting to the death
alongside a giant, miniature space hamster
. I guess there are two types of continuities: one that makes it work, and one that makes it make sense. If the story pieces fit together a bit better and Act 3 wasn't being all Act 3-y with us at the moment, the shift between serious and silly might be less jarring.
It would be difficult for Larian to take the time and explain the history of mind flayers or the roles the deities play in the D&D universe without tons of tedious exposition, but they could have done a little better job.
And honestly, the Emperor and finally figuring out his identity ... I did not care for his story at all.
So BG3 is both very like and unlike D&D at the same time.