Here's my own theory on the origin of the Pokemon universe. Warning! Massive wall of text inbound!
In the beginning, there was nothing. And then there was an egg, which hatched and formed Arceus. At this point the universe had no space or time; only Arceus. So Arceus used its then-omnipotence to create Dialga, the being of time, and Palkia, the being of space. Dialga was given the job of setting the universe in motion, while Palkia expanded space in all directions and in infinite dimensions. At this time, Arceus, with the help of Dialga and Palkia, created all of the stars, galaxies, planets, etc. But this universe was fundamentally unstable; Dialga and Palkia effectively had to micromanage it. So Arceus created another universe that would support this one; a reverse universe, if you will. It would be inhabited by Arceus's next creation, Giratina. Now the universe and the Distortion World would act as backbones to each other, and at last the universe was stable. But Arceus was still not pleased, for it had a gentle side as well. So Arceus created a planet that was to be unlike the coldness of the rest of the universe: it would be warm, and teeming with life.
But for now, the planet was nothing but barren rock, scorched by a sun. So Arceus breathed over the planet, and its breath became the atmosphere. This atmosphere would protect this planet from the sun's deadly rays. But the planet was unmoving; it lacked the spark of life. So Arceus created the ancestor of all intelligent life on Earth, Mew. Mew, like Arceus, was immortal, and was given the ability to bring forth all manner of Pokemon. But on this barren planet of nothing but rock and air, no life would survive, let alone multiply. So Arceus created the first guardian of Earth, Kyogre, and He appointed Kyogre to cover the Earth in life-giving oceans. So Kyogre was set upon the Earth, and in an instant a huge volume of water began to pour from its body until the entire Earth was covered in oceans and swamps. Mew then brought forth plants such as kelp and seaweed, as well as Pokemon such as Omanyte, Omastar, Kabuto, Kabutops, Tirtouga, Carracosta, and Relicanth. And so these Pokemon multiplied and lived in the waters of the Earth for several million years. And so it was the First Age, when the Earth was flooded and ruled by Kyogre.
But eventually Arceus grew displeased with the water-covered Earth. So He sent Kyogre into a deep sleep, and created the second guardian of Earth, the Terrestrial One, Groudon, from an underwater volcano. Arceus placed Groudon on the driest part of Earth (which isn't saying much), and commanded Groudon to dry the planet up. Immediately, the sun's rays became many times more powerful, and the oceans shrank as massive mountains rose up out of the ground. Soon water only existed in small lakes and rivers, and the aquatic Pokemon began to go into decline, and eventually became extinct. Mew created plants such as cacti and palm trees, in addition to Pokemon better suited to the hot, dry environment, such as Yanmega, Trapinch, Vibrava, Flygon, Cranidos, Rampardos, Shieldon, Bastiodon, Aerodactyl, Tyrunt, and Tyrantrum. In addition to this, Mew created the first Bird Pokemon, Archen and Archeops. And so it was the Second Age, when Earth was largely mountains and desert, ruled by Groudon.
But once again, Arceus became displeased eventually, and brought Kyogre back out of its slumber. Arceus hoped that Kyogre and Groudon would rule side-by-side and keep the world in balance, but instead, Kyogre and Groudon began to quarrel more and more, until eventually they were raging an all-out war, with massive tidal waves destroying land life, and catastrophic volcanic eruptions obliterating sea life. Arceus was furious at this, but did not want to destroy them. Instead, Arceus created the third guardian, Rayquaza, who had powers that could balance Groudon and Kyogre's and would rule the sky. Now the land and the sea were in balance, and so began an age of great prosperity. Mew covered the Earth in thick forests and jungles, but didn't like that Earth was just one big continent surrounded by ocean. So Mew prayed to Arceus, and Arceus created Regigigas who, after waiting for 5 turns, used its tremendous strength to break apart Pangaea and move the continents to where they are now. Regigigas also created three statues out of clay, ice, and magma, and Mew gave them life. Arceus, pleased with this, sent Regirock, Regice, and Registeel to guard the geography from deep underground. Regigigas, his work done, went into a deep slumber and changed to stone. Now the Earth had something new: diversity. Different latitudes had very different climates, and so Mew created different Pokemon for different parts of the globe. Near the equator, Mew made dense jungles which would be home to Pokemon such as Sceptile and Breloom. And so it was the Third Age, when Earth was in balance.
Further away from the equator, the temperature was more mild, and so Mew brought forth windswept grasslands home to Tauros, Bouffalant, Doduo, Dodrio, and Nidoran, while up above flew Pokemon such as Swellow and Pidgeotto. Mew also made vast forests spring up, in which many Bug and Grass Pokemon would inhabit. Way up at the poles, where the weather was very cold, Mew created Pokemon such as Mamoswine, Walrein, Amaura, and Froslass which were adapted to the icy climate, while in the rocky terrain of mountains came Pokemon such as Geodude, Onix, Machop, Larvitar, and Lucario.
But the Earth was still missing something. Now many types of Pokemon filled the Earth, but Mew thought that there should be something more. An intelligent creature, who would be able to understand the world on a much deeper level. Mew made several tries to make a creature that was smarter, but failed every time, resulting in Pokemon such as Alakazam, Gallade, and Chimchar. Mew lacked the power to create spirit, and so he once again prayed to Arceus. Arceus responded by making three final creations: Uxie, the being of knowledge; Mesprit, the being of emotion; and Azelf, the being of willpower. Mew, greatly thankful, took the body of a Machop, and the three pixies at last endowed it with spirit, thereby creating the Pokemon world's first human.
Stories of minor legendaries
Articuno, Zapdos, Moltres, and Lugia
Early on in the Third Age of Earth, Mew took three Bird Pokemon and gave them powers. They were given the job of controlling the weather, but their powers were much weaker than Kyogre and Groudon's. Articuno inhabited the arctic regions and caused great blizzards. Zapdos flew throughout the world and caused lightning storms. Moltres was gentler than Articuno and Zapdos, and brought sunny skies wherever it went. Arceus, fearing that the birds would be too powerful, created Lugia to balance them. Lugia, however, caused terrible hurricanes and tornadoes of unparalleled force wherever it went. Arceus, angry with Lugia, banished it to the bottom of the ocean to be Kyogre's servant.
Raikou, Entei, Suicune, and Ho-oh
In the ancient Johto Region, there were two towers: the Tin Tower, which still stands today, and the Brass Tower. One day in the Brass Tower, three Pokemon entered it: Jolteon, Flareon, and Vaporeon. But there was a strange energy surrounding the tower that caused their powers to grow out of control. Jolteon called down a terrible lightning strike, Flareon set the tower ablaze, and after some time, Vaporeon finally called torrential rain to put out the fire. But it was too late: the tower lay in ruins, and all three had perished. But then a miracle happened: A rainbow from Arceus fell on the charred remains of the tower, and out of the ashes soared the rainbow incarnate: Ho-oh. Ho-oh then shone its seven colours on the tower, and the three Eeveelutions sprang out, their true forms revealed as Raikou, Entei, and Suicune. Ho-oh still soars through the skies on a rainbow to this day.
Celebi
When Mew created the forests in the Third Age, Celebi was born along with them. Since Celebi is one with the forests, it suffers massively when they are damaged. Thus, Celebi became the protector of all nature, and due to its devotion to the forests, even Dialga was impressed, and gave it the ability to travel through time. Dialga put barriers in the space-time continuum to avoid paradoxes; thus, although Celebi can go forward in time indefinitely, it is unable to go back before it was born.
Latios and Latias
Latios and Latias are, contrary to popular belief, not legendary, but are simply very, very rare. But they have one interesting characteristic: a Latios and a Latias that are born together share one soul, which can sometimes manifest itself as the Soul Dew. They will only accept orders from a trainer who has a pure heart.
Deoxys
Deoxys is a virus that was flung into space by accident when Arceus created Mew. It naturally evolved, before coming back to Earth in modern times to be shot with a laser.
Darkrai and Cresselia
Darkrai is a creation of Giratina, who resented Arceus for banishing it into the distortion world. So, it created darkness incarnate, which would torment all living things on Earth for eternity. This began a dark time, when Darkrai swept across the world, giving all who saw it terrible nightmares. Since Darkrai was created out of spite, it means no harm, but still greatly harms all around it. Eventually, though, came a full moon, and Mew used the light of the full moon to create Cresselia, who had the power ward off nightmares, and could banish darkness. Cresselia is the only being that Darkrai truly fears.
Reshiram, Zekrom, and Kyurem
This legend is well known. Once upon a time, there were two brothers. They originally worked together with an ancient dragon to found a nation, but over time, the brothers started to argue. The older one wanted a world of truth, while the younger wanted an ideal world. The dragon, torn, split its soul into two parts: Reshiram sided with the older brother, and Zekrom sided with the younger brother. The empty shell of the original dragon became Kyurem, who waits for its empty body to be filled again.
Cobalion, Terrakion, Virizion, and Keldeo
These Pokemon were originally not legendary, but they earned their legendary status when there was a great forest fire caused by humans, in which many Pokemon were in mortal danger. The musketeer trio worked to save each and every Pokemon: Virizion put out fires with its swift movements, Terrakion caused great landslides to form barriers, and Cobalion led the Pokemon out of the forest to safety. Among the Pokemon rescued was Keldeo, which the three adopted and raised as one of their own.
Tornadus, Thundurus, and Landorus
Tornadus and Thundurus were causing a lot of trouble. Tornadus caused terrible hurricanes, and Thundurus, unlike Zapdos who restrained its power, shot lightning out of its cloud with no restraint. They caused destruction all over Unova, causing people everywhere to despair. Landorus, the eldest of the three, was furious at the other two, and punished them by banning them to Ubers sealing them inside a shrine for one thousand years.
And so ends the massive wall of text. What do you guys think?