I’m mainly curious of how the tales of the medieval time came about in different parts of the world. From what I have seen, many countries have their own versions of elves, mages, dwarves, dragons, magic and I’m wondering how it spread. I’m curious if there is any evidence that they might have existed in the past or if they were bed time stories told to children (and even then where did they originate from?).
Belief in the supernatural is international. Your question touches on several topics, each of which have generated many books, but it is possible to take this apart carefully and attempt to present a few concise answers.
Although many folk stories were/are told to children, and many more were told as fiction (usually called folktales by folklorists) for adults, this doesn't preclude many of the topics of these stories from also being matters of belief and the focus of stories usually told to be believed (typically referred to as legends). Again, internationally, stories told as fiction and those told to be believed both include supernatural entities - as well as normal men, women, and children.
There is no reason to assume that any supernatural entity - whether humanoid or animal in form - is based on anything that existed in the past. Many have constructed theories along these lines, and while they are often seductive, these scenarios cannot be proven, are often easy to demonstrate as false, and/or are simply not needed to understand folk belief. For example, one often sees the idea put forward that dinosaur skeletons are the basis of beliefs in dragons: while fossils may have helped put wind in the sail of belief, there is no reason to conclude that this was the origin of the tradition. The result is a rather unsatisfying answer to your question about the origin of belief in the supernatural: it is something we simply cannot really know. Again, beliefs are international and historical cultures burst onto the scene with written records exhibiting beliefs and tradition in full blossom, so it is clear that these sorts of beliefs - and related stories - are part of a prehistoric legacy that may go back tens of thousands if not hundreds of thousands of years to a time we can only dimly imagine.
Given that last point, it would be easy to imagine that many supernatural beings are linked by some common, ancestral belief system. It may be possible that this might be the case, but again it would be difficult to prove, and more often it seems less likely to be the case. Supernatural beings that seem similar - ghosts, dragons, elves - seem as though they have international counterparts, but upon closer inspections, dramatic differences suggest that a common ancestor is less likely. The ground-crawling, Northern European worm/dragon (which later took to the sky with wings) was a nemesis that is very different from the often beneficial Asian supernatural entity, which only as a matter of linguistic limits is described with the same English term. Belief in people surviving death are international, but a walking corpse is different from an ethereal spiritual manifestation. And while European elves steal babies and replace them with changelings and the Northern Paiute paúngaa’a does much of the same, the European stories tell of the return of the baby by a community of elves that merely wanted the human as an addition to their society, while the paúngaa’a has eaten the baby and seeks the opportunity to chew into the mother's breast, only to slither back into the water from which it came. These are all so different, it is less likely that they descend from a common ancestor.