To me, D&D is a Role Playing Game in which:
-PCs portray heroic characters. Not heroic in that they do good things, but heroic in that they do amazing things--that they are larger than life.
-The action takes place in a magical world that resembles Earth's past. Doesn't have to be medieval: Anything from the stone age to the Victorian Era can still capture the D&D feel.
-The world is populated by creatures drawn from myth (elves, dragons, minotaurs), creatures inspired by fiction (halfling, mind flayer), and creatures unique to the game (Beholders, Shadar-Kai)
-Conflicts are resolved primarily through combat. Not always, but often enough that combat is the main focus of the game's ruleset.
-In which actions are resolved by rolling a small number of dice, and comparing or applying the numbers rolled, rather than scoring successes or similar.
Or
(and this is important)
-A game whose rules are substantially similar to those described above, and whose setting and character are created as a response to or outgrowth of the Dungeons and Dragons game.
This last point covers settings like Dark Sun, Planescape, And even Urban Arcana, which all feel like D&D to me.
This is a pretty broad set of criteria, that can easily cover a lot of games besides D&D. Which is entirely appropriate, since I've often played other RPGs and thought to myself "This game feels like D&D".