The stories that are handed down from ancient times can seem infinitely weird to us, because we are familiar with the scientific method and modern technology that allows us to explore the nature of things. That doesn't mean there weren't smart people around way back then, but even those who figured there was a logical explanation somewhere had to find a way to explain the world to the uneducated masses. Imagine you were a person of some education and experience in the Dark Ages, and so were considered a medicine man or a wizard. You had to find a way to explain why this place wasn't good for castle construction to an illiterate king, so fire-breathing dragons it was.
Well, it's hypothesized that, back in the Iron Age, people would seal up treasure in the tombs of kings and rich people. The thing is, they would seal these tombs with a ton of things that decomposed: people, animals, vegetables, etc. The buried flesh would emit gasses as they decomposed, and with nowhere to go, they would create pressurized gas pockets. Try to open the tombs with a torch so you could see, or cause a spark with an iron spade, and BOOM!: big, firey oblivion in a world where Michael Bay wouldn't be around for thousands of years.
In Wales, there was a king who was trying to make his walls impenetrable. The only thing is, the walls kept falling down. A young real-life Merlin told the king that it was dragons fighting underground, possibly because he believed it, possibly because when a king asks you a question, you give him an answer even if it's nonsense. Instead of underground lizards, it was more likely gas pockets buried in the vast Welsh coal deposits underground.
Read more about fire-breathing dragons, plus the likely real-life explanations for witches, vampires, and more at Cracked.