D&D is it's own mach-up of many things taken from genre fiction of the 50-70s. From the beginning it had sci-fi, post-apocalyptic and pulp influences in Blackmoor.
Maybe the term 'Frankenfantasy' would be appropriate!
Some D&D settings fall within an existing genre, but the default assumptions of D&D (which haven't really changed much over the decades) are its own thing. It does not fall within a particular genre, or rather it is its own genre I suppose.
I've always (always = since 1993 or so) viewed D&D as a framework of rules, on which anything can be hung. So when I think D&D, I think of a rule structure, not so much a genre.
My campaigns have mostly leaned toward science fantasy/weird fiction - like Masters of the Universe meets Conan. But that's almost coincidental, and it's not necessarily what I think when I think "D&D."
It's hard to pinpoint a singular term to describe a system that tries to incorporate all styles and genres of fantasy. So I guess it's whatever genre you think it is or want it to be.
Currently running two games (an AD&D one and a 5e one).
One of them is definitely more of a eleventh to twelfth century setting with magic (and a focus on Knighthood, titles, and church conflicts) while the other is more of your standard High Fantasy with no real historical precedent but sort of imitating an American West with modern mores in Fantasy European clothing (ala...Forgotten Realms).