How can you tell science fiction from fantasy? Short answer: Science fiction has space ships. Fantasy has wizards and dragons.
Okay, it's not quite that simple. But it's certainly true that a great deal of modern fantasy set in a more-or-less medieval world features wizards and dragons. Tolkien's Lord of the Rings did. (Though there are more dragons in The Hobbit than the actual LotR.) George Martin's Song of Ice and Fire does. (Though his wizards are sort of weird and marginal.) (Click here for more on medieval-themed fantasy.)
My own fantasy features wizards and dragons, as seen in the above image. The artist is Darrell Sweet. Well, it isn't strictly speaking a dragon, it's the skin of a purple flying beast, but people in the story often mistake them for dragons. (Shameless plug: Get the story to read on your Kindle here.)
But did the literature of the Middle Ages feature wizards and dragons? Actually much less than you might have expected. Since magic was always viewed with suspicion during the real Middle Ages, in the assumption that it was fueled by demons, you would not have wizards as heroes. We now associate Merlin with King Arthur stories, but the early King Arthur stories had no such person in them. Merlin appears in the fifteenth-century versions, but he disappears quickly, captured by a nymph.
Modern versions of wizards are mostly derived from Tolkien's Gandalf, a very powerful and wise person who just shows up, and who is semi-immortal. But for a lot of modern authors (including JK Rowling and me), wizardry is something to be studied and learned. (Rowling had the equivalent of the British "public" school or the American prep school, I the equivalent of graduate school.)
Dragons are quite rare in medieval literature. They were often indistinguishable from serpents. The best-known dragon is in Beowulf, who (spoiler alert!) ultimately kills the hero. A dragon also features in the Nibelungenlied, where it turns out it had originally been something almost human, and where Siegfried kills it. In both of these the dragon is associated with a golden horde, which it guards jealously, a motif Tolkien picked up. The gold, not surprisingly, is cursed.