Dragons! These magical fire lizards are a solid mainstay of fantasy, from ancient myths to The Hobbit to Pokemon cards. In some stories they're the treasure-obsessed embodiment of evil, while in others they're more of a big wild animal with no particular agenda. Sometimes they're the dog in a classic boy-and-his-dog story (but like a very cool dog that you can ride), and sometimes they're highly intelligent creatures who live in their own parallel society to the human race. And in George R.R. Martin's Song of Ice and Fire, they're a little bit of everything.
Of course, the dragons in The Game of Thrones are instantly recognizable as dragons — or as European dragons, at any rate. Many different cultures have their own dragon myths, and not all of them are sheep-stealing, fire-breathing monsters. Chinese dragons, for example, typically appear in mythology as wise and benevolent deities. Traditional European dragons, on the other hand, have more of an evil Benedict Cumberbatch vibe to them. English dragons, in particular, often represent specific enemies to the dominant culture, like the Christian devil. But modern fantasy authors have subverted and switched around and combined dragon lore from all sorts of different cultures into a myriad of lizards.
So which specific bits of dragon mythology did Martin pick for his own sweet lil' dragon babies?
Well, to begin with, I can't possibly name every single literary and historical influence on Martin's dragons because A) I don' t have all day and B) I don't live inside Martin's head. There are a lot of sources to choose from. Like those in Tolkien's Middle-Earth, his dragons are terrifying and pose a threat to the good people of Fantasy England. Like those in Anne McCaffrey's Pern books, his dragons bond with a single rider and have more magical properties than your usual fire lizard. Like the dinosaurs of Jurassic Park, his dragons are able to switch genders at will (or are maybe just kind of chill and non-binary to begin with).
Dany's dragons are an amalgam of old and new dragon tropes. They have more than a little of the classic boy-and-dog or girl-and-horse flavor to them, but they're also wild animals that can't be so easily contained. In the books, especially, the dragons aren't nearly as dog-like as the Stark babies' wolves, and they aren't as genteel or intelligent as your Benedict Cumberbatch-as-Smaug. They eat sheep and (sometimes) children. They resent being locked in a Meereenese basement. They aren't all that concerned with who does or doesn't have a drop of super special Targaryen blood when it comes to burning Quentyn "Poor Life Choices" Martell to a crisp. Even precious baby Drogon, the one dragon who allows Dany to ride him, doesn't really listen to her.
The dragons walk the line between wonderful fantasy pet and harrowing mythological monster. To understand where they truly come from, we have to go further back, to our real world equivalent of the Age of Heroes.
One of the first "typical" European dragons, with the fire and the scales and the horde of treasure, appears in ye olde Anglo-Saxon epic Beowulf. Our hero, Beowulf, fights three big scary monsters over the course of the poem: a big troll guy, the big troll guy's mom, and then a dragon who doesn't seem to be related to the troll family (and is therefore kind of out of left field).
The Beowulf dragon establishes dragons as Evil and Scary in the European imagination. Like in Martin's world, the dragon represents an existential threat to the Anglo-Saxon/Scandinavian people trying to defend their homeland (the story was written down by the Anglo-Saxons, but set in Scandinavia, where it's colder and sexier). But of course, the dragon is slain at the end, albeit taking Beowulf with it. Dany's dragons are a tad less straight up and down evil than that, and they haven't yet shown much interest in hording precious metals.
Besides, Westeros isn't just Fantasy Europe: it's Fantasy Britain. In more specifically British dragon lore, an allegorical battle between a white and red dragon represents the struggle between the invading Anglo-Saxons and the native Welsh. In some adaptations of the story, the white dragon even breathes ice to the red dragon's fire. The invading Romans in early Britain also brought dragons with them (well, windsock puppet dragons), and the Roman St. George, who became the patron saint of England, is best known for his dragon slaying stunts. So perhaps not a coincidence that the Targaryens have such strong Roman empire vibes.
Clearly, Maester Martin is pulling from some solid historical precedent for his quasi-British dragon lore, even if his dragons are slightly more literal. He's also fairly aware of the dragon's place in the modern world of fantasy literature: when the dragon eggs hatch at the end of book one, magic begins to return to the word of Ice and Fire at a startling rate. The dragons seem to be almost responsible for turning the books into high fantasy, as opposed to very inaccurate historical fiction.
As for whether the dragons will prove themselves to be evil monsters in the end, or whether they're just innocent animals, or whether they're going to be slain in the end... you'll just have to wait and see.