Dungeons & Dragons takes inspiration from all kinds of fiction. Its base premise and setting draw heavily on storied works of fantasy fiction like The Lord of the Rings and Conan the Barbarian. Across D&D Fifth Edition's vast array of settings, campaigns, and player books, it further draws from mythology, comedy, and even science fiction.
Source:https://www.cbr.com/dnd-5e-character-choices-classic-horror-influences/