Hardly anyone believes in dragons nowadays, despite all the effort the Game of Thrones special effects team have put into making their creations look realistic. Nobody has ever found a real live dragon, and there are no fossils of them, so it is reasonable to say that they do not exist and never have.

But could they have? Are dragons as we understand them genuinely impossible, or is it simply that evolution has not, yet, thrown them up?

Let's imagine what it would be like if dragons really did exist. Not creatures that just look a bit like dragons, but actual flying dragons that breathe fire. How would such animals have evolved? What would their place be in an ecosystem?

Our ancestors had no need to employ high-tech computer wizardry to create convincing dragons.

"Most peoples at some point in their history have believed that the dragon was real," writes anthropologist David E. Jones in the introduction to his book An Instinct for Dragons. In its pages, Jones asks why myths about dragons are so ubiquitous, citing examples from places as diverse as Hawai'i, Iceland and New Zealand.

When imagining dragons, people have always taken their cue from reality

His answer involves monkeys. On the African savannah, troops of vervet monkeys face three kinds of predator – snakes, eagles and big cats – each of which is recognised with a specific alarm call. This alarm-calling behaviour has been extensively studied and used to understand analogous behaviours in humans.

Jones suggests that the dragon is an amalgam of these basic primate fears. The sinuous scaliness of the snake, the wings of the eagle, and the jaws and claws of a big cat combine to form a fearsome memory in an ancient part of our brains.

It is a neat idea, albeit one that is virtually impossible to test.

What certainly is true is that, when imagining dragons, people have always taken their cue from reality. The ancient Chinese philosopher Wang Fu even echoed Jones' theory when he described dragons as possessing the necks of snakes, the claws of eagles and the soles of tigers.

But to find something that looks more like dragons as we imagine them, we need to look at animals from the distant past.

Whatever culture they appear in, dragons are always reptilian. That means the Mesozoic Era is the place to start. It lasted from 252 million years ago until 66 million years ago, and is known as the "Age of Reptiles". The most famous Mesozoic reptiles are of course the dinosaurs.

Any real-life dragons would have filled a similar niche to that occupied by apex predators like Tyrannosaurus rex

The similarities between dinosaurs and dragons are well documented. There is a long history in China of identifying fossilised dinosaur bones as those of dragons.

Palaeontologists have also playfully nodded to dragons when naming their new discoveries. In the dinosaur pantheon we have everything from the "dragon king of Hogwarts" (Dracorex hogwartsia, a spiky-headed pachycephalosaur) to the "dragon of Qijiang" (Qijianglong guokr, a 50-foot long sauropod).

Based on their appearance, as well as their taste for large prey like knights and fair maidens, any real-life dragons would have filled a similar niche to that occupied by apex predators like Tyrannosaurus rex.

However, a closer look at dragon anatomy suggests it would be wrong to group them with such creatures taxonomically. Instead, the two distinct dragon body forms hint at two alternative evolutionary scenarios.

The first group of dragons contains the lóng of China, the drakon of Ancient Greece and the Old English wyrm. These are all dragons with elongated bodies and small legs, or no legs at all. In appearance these creatures are essentially snakes, so we should look at the snake family tree.

Among animals with backbones, wings have evolved three separate times: in birds, bats and pterosaurs

There is fossil evidence to suggest that the first snakes evolved from burrowing lizards, whose legs shrank and eventually disappeared as they adapted to an underground lifestyle. This fits with many classic depictions of subterranean dragons, such as the Nidhogg of Norse legend or the Greek "earth-dragon" Python, which gave its name to the real-life genus of large, constricting snakes.

What sets these creatures apart from your average snake is their size. However, that is not a major problem: we only need to look at the fossil record to find some truly dragon-sized snakes.

At 40ft (12m) long, with a body as thick as a man's waist, the mighty Titanoboa was a true monster. It could easily have been the ancestor of a lineage of gigantic, serpentine dragons.

But when you think "dragon", chances are you are not thinking of a giant snake. You are imagining the other type of dragon: a creature with large, leathery wings bursting from its shoulders. In short, you are imagining a creature that – from an anatomical perspective – should not exist.

Among animals with backbones, wings have evolved three separate times: in birds, bats and pterosaurs. Each time they evolved in roughly the same way: non-flying ancestors gradually transformed their forelimbs into membranous wings supported by modified fingers.

The giant azhdarchid pterosaurs were perhaps the largest animals ever to take flight

This means that, for a vertebrate, having wings is a trade-off. You can have arms or wings, but not both.

Body plans are highly conserved, so while it is not impossible to imagine a six-limbed vertebrate, the evolutionary leap required is huge. When extra limbs do occur, they tend not to be adaptive. Instead, they are the result of birth defects or, in the case of some unfortunate frogs, parasitic infections.

Perhaps this is why in so many modern fantasy films, from Harry Potter to The Hobbit, the classic six-limbed dragon has been ditched in favour of a sleeker four-limbed model. Such a creature is more accurately called a "wyvern", and it is at least anatomically more realistic.

There is still the not-insignificant problem of how to get these enormous creatures off the ground. Fortunately for dragons, another group of prehistoric reptiles give their ambitions for flight some hope.

Named after a dragon from Uzbek folk culture, the giant azhdarchid pterosaurs were perhaps the largest animals ever to take flight, and the group most likely to give rise to real-life dragons.

When birds fly, they get 90% of their launch power from their back legs

An image by palaeoartist and pterosaur researcher Mark Witton of the University of Portsmouth in the UK makes this clear. It shows one species of azhdarchid, Arambourgiania philadelphiaestanding as tall as a giraffe. The largest azhdarchids had wingspans of around 36ft (11m).

These enormous animals could fly, but doing so required a set of specific adaptations. These included a hollow skeleton, to minimise weight, and sturdy upper arm bones on which to anchor massive flight muscles.

Our hypothetical dragons would need the same adaptations. They would also have to make certain anatomical sacrifices.

"When birds fly, they get 90% of their launch power from their back legs, and then they transfer over to their wings," says Witton. "That means they need to have much bigger bodies, because they need to have two big sets of muscles to get into the air."

Reptiles can master many problems that mammals can

Pterosaurs, on the other hand, relied on their already considerable front-limb/wing strength to launch themselves into the sky. "They don't need to worry about carrying all their leg muscles into the air with them after they've taken off," says Witton. "That of course means that they can get much bigger."

In other words, the largest pterosaurs only got that big by having relatively small torsos and legs. "Birds get to about 80kg [176lb] and that's as heavy as they can ever get and still fly, whereas a [flying] pterosaur can get to four times that weight," says Witton.

Our dragons would have to make the same trade-off. It does not diminish them too much, but it does confine the more bulky, lumbering depictions of them to the scrapheap.

So let's suppose that our proposed dragons were an offshoot of the giant azhdarchid pterosaurs, or another similar group of flying reptiles that evolved in parallel. How feasible are some of their other, more magical attributes?

Mythological dragons are often highly intelligent. This can manifest in a kind of malevolent cunning that they use to outwit potential dragon-slayers, or – in the case of Eastern dragons – immense wisdom that is shared with only the most fortunate humans. Either way, dragons possess cognitive abilities that we do not usually associate with reptiles.

Historically, scientists have used the term "reptilian" to describe the parts of the human brain associated with basic functions such as breathing. Reptiles themselves have often been described in such terms – that is, driven by instinct and not intellect. However, in recent years scientists have begun exploring reptile intelligence in a more considered way, designing reptile-specific tasks that properly test their intellectual limits.

While actual immortality is unlikely, reptiles like giant tortoises and tuataras can clock up well over a century

Their conclusion? "Reptiles can master many problems that mammals can," says Gordon Burghardt of the University of Tennessee in Knoxville. "Complex problem-solving, reversal learning, social learning, complex sociality, tool use and individual recognition have all been discovered."

Some of the more intelligent reptiles are the larger species with correspondingly large brains, such as crocodiles and monitor lizards. Another potential contributor to intelligence is longevity, which has also been associated with bigger brains. Dragons are certainly not lacking in size, but what about lifespan?

Many dragons of legend are eternal, ageless creatures, whose lives can only be ended at the hands of a burly hero with a big sword. While actual immortality is unlikely, reptiles like giant tortoises and tuataras can clock up well over a century. The key to such extended lives could be a slow pace and a correspondingly slow metabolism.

That would explain why dragons spend so much of their time lounging around on piles of gold. Speaking of which, could such gold-lust ever evolve?

Given people's enthusiasm for gold and their willingness to fight for it, at first glance it seems that a taste for shiny metal objects would be a distinct disadvantage for even the most well-armoured dragon.

However, some animals do have a thing for bright objects. Many readers will immediately think of magpies, but in fact studies suggest that magpies' supposed love for shiny things is just a superstition.

A dragon's hoard could be an elaboration of the bowerbird system, with female dragons choosing males with the biggest stack of gold

Bowerbirds are a different matter. To attract females, male bowerbirds line the floors of their "bowers" with all sorts of treasures, albeit humbler ones than those found in a dragon's lair. Instead of jewels and coins, bowerbirds hoard berries and pieces of broken glass.

These bizarre birds have been key players in the study of "sexual selection": the idea that certain traits evolve because one sex prefers certain characteristics in the other.

Female bowerbirds choose males with high-quality bowers because such bowers are an indicator of quality. If a male has the energy to seek out and arrange the best possible bits of glass, he probably has good-quality genes that will ultimately be passed on to his children. The system works rather well. A dragon's hoard could be an elaboration of the bowerbird system, with female dragons choosing males with the biggest stack of gold.

Our dragons are shaping up nicely. So far we have prehistoric reptiles, maybe a sister group to the giant pterosaurs or giant snakes, with advanced cognitive abilities to match their size and longevity, and a complex mating system based on the procurement of shiny, metallic objects.

This may not sound too far-fetched. But of course we have missed out dragons' most fantastical ability: fire-breathing.

Spitting cobras can fire venomous projectiles from their fangs. The sting of a bullet ant has been described as "like walking over flaming charcoal with a three inch nail embedded in your heel." A bite from a Komodo dragon will leave a wound slathered with toxic proteins. There is no denying that nature has come up with all sorts of horrifying ways for animals to hurt each other, but a flaming discharge is not one of them.

The only things that come close are rather unassuming-looking creatures called bombardier beetles. These insects store hydroquinone and hydrogen peroxide in their abdomens. When provoked, they initiate a violent chemical reaction that ejects a near-boiling-hot stream of chemicals at the unfortunate attacker.

Imagine an evolutionary convergence that bestows analogous chemical weaponry on an enormous reptile. Two glands in this creature's neck secrete the necessary solution, and when they mix in the back of its throat, a jet of gas and scalding liquid is expelled from its mouth.

Such a creature is highly implausible, of course, but then so are bombardier beetles.

They initiate a violent chemical reaction that ejects a near-boiling-hot stream of chemicals at the unfortunate attacker

These beetles have even been cited by creationists as evidence that the theory of evolution cannot be true, on the grounds that they could not have evolved naturally. These anti-evolution arguments have been firmly refuted by scientists, who have outlined the key steps in the transition from non-explosive to explosive beetles.

It is understandable that people are incredulous about these remarkable animals, but as the old adage goes, "truth is stranger than fiction". Evolution has yielded some remarkable innovations over the eons.

Dragons may only exist in the human imagination, but the real world can more than match them for strangeness.

Join over five million BBC Earth fans by liking us on Facebook, or follow us on Twitter and Instagram.

If you liked this story, sign up for the weekly bbc.com features newsletter called "If You Only Read 6 Things This Week". A handpicked selection of stories from BBC Future, Earth, Culture, Capital, Travel and Autos, delivered to your inbox every Friday.