[Do note that this takes a more traditional approach to what the nine worlds of Norse cosmology are than what I did here. Also note that this is in no way an accurate description of Norse cosmology.]
In the beginning there were but two realms: Muspelheim and Niflheim.
Muspelheim was home to great heat, a realm of fire, melted rock, and light. Nifelheim was a place of cold, home to ice, frigid air, and darkness.
Besides them there was nothing, but over time that changed. The empty space of Ginnungagap became heated by Muspelheim and cooled by Niflheim and in its center spark met frost. From this meeting the first life was born.
The First Life
Ymir and Audumbla, the first jotun and the first cow, were born. The great cow Audumbla licked the salty ice and from her udders ran four streams of milk that nourished Ymir.
The heat of Muspelheim caused Ymir to sweat, and from the sweat were three jotuns born. Of his armpits' sweat came two jotuns, male and female, of unremarkable form. As his legs rubbed together they produced a sweat that brought forth the third jotun, a male with six heads.
Meanwhile Audumbla's licking of the ice warmed it, and from the melting ice Buri, the first god, was born.
For two generations of there was peace.
Buri's son Borr wed the Jotun Bestla, daughter of, Bolþorn.
Bestla bore three sons: Odin, Vili, and Ve.
Þrúdgelmir, one of the sweat-produced, had a son named Bergelmir.
The Pieces of Ymir
The sons of Borr slew Ymir, and Ymir's blood drowned all the Jotuns save Bergelmir and his wife.
Ymir's corpse was brought to the middle of Ginnungagap and from it a new world was formed. The sons of Borr formed land from his flesh and sea from his blood. They made mountains of his bones and ground his teeth into sand and gravel the sky they formed from his skull, from his brain they made clouds.
The maggots that grew within his corpse were transformed into the elves, who at that time were neither dark nor light.
Into Ymir's skull, the sky, the sons of Borr fixed many of the sparks of Muspelheim, while beneath the skull but above the clouds they set more of Muspelheim's lights, giving each a fixed path to trace.
In this time gods, elves, and jotuns multiplied, but the sons of Borr were not finished with the world they'd created yet.
Desiring to give a world to a new race of their own creation, they used the eyebrows of Ymir to create walls between worlds. With one eyebrow they blocked off the land the jotuns had taken, creating Jotunheim. With the other they cordoned off the elves, forcing them all back underground.
Of Elves and Humans
The elves who remained underground became the dark elves, or dwarfs, and so their home is known as Svartalfheim [home of the black elves], but some elves missed the sky and the lights of Muspelheim that had been set in and beneath it. They longed for the trees and plants that had grown on the world in Ginnungagap.
These elves did not oppose the sons of Borr by attempting to return to the world in the center of Ginnungagap, instead the journeyed far and wide looking for a world like the one they had known. They never found such a world, and finally they decided to make one themselves, bringing together the frost of Niflheim and the sparks of Muspelheim in a new place.
These elves called their new home Alfheim, though some call it Ljosalfheim [home of light elves] to distinguish it from the home of the elves that had remained where the sons of Borr had set them.
Meanwhile the sons of Borr created the race of humans from trees they had found on the world in the center of Ginnungagap. Of the trees they formed two beings, Ask and Embla, Odin gave humans life and soul, Vili gave them intelligence and emotion, Ve gave them form and senses. The humans were also gifted clothing, names, and the world itself.
It was then that the sons of Borr separated their own dwellings from those of humanity. The world in Ginnungagap was split a final time, the sons of Borr living in what became Asgard (the sons of Borr named themselves and their families "Aesir), while humanity inherited Midgard, which still lay at the center of Ginnungagap. As a bridge between Midgard and Asgard the Bifrost was constructed, so that gods would never be cut off from men.
Other Gods, Other Jotuns, and Other Creations
It was then that the sons of Borr relaxed and noticed changes to the universe they had not made.
Gods beyond themselves had formed a world of their own, Vanaheim, and the sons of Borr did not know how this had come to be. Were these gods, the Vanir, forgotten descendants of their own from when god, jotun, and elf had lived together and multiplied on the world in Ginnungagap?
The sons of Borr couldn't believe that, but if the gods didn't descend from Borr, where had they come from? If Vanaheim hadn't been created from the remains of Ymir like Asgard, Midgard, Svartalfheim, and Jotunheim, what had it been made of?
Vanaheim didn't seem to be at a crossroad between Muspelheim and Niflheim like Ljosalfheim, so it didn't seem possible it was created in the same way.
Had Audumbla given rise to a god other than Buri? Had there existed siblings of Borr they were never told about?
The sons of Borr uneasily appraised the Vanir, while noting still more things that had previously escaped their notice.
While they'd been aware of the migration of the elves and the creation of Ljosalfheim, they were not prepared to see jotuns outside of Jotunheim (apart from those they or their descendants had taken as spouses.) They certainly didn't expect to find any in Muspelheim.
Yet there they were. When had they settled there? Had they, like the light elves, migrated after the world in Ginnungagap was divided by the sons of Borr? Or had they settled there much earlier? Perhaps some jotuns had never been satisfied living on a world created from the corpse of Ymir, a fellow jotun, and they'd parted with the other jotuns soon after the world in Ginnungagap was created.
More disturbing than the question of their origin was their form. Muspelheim was a harsh and unforgiving home and those who had settled there had grown unlike the jotuns the sons of Borr had known before. They became the Eldjotuns.
Even the space between worlds was unlike what had been expected. Instead of empty remnants of Ginnungagap, there was now a structure binding the eight realms together: the great tree Yggdrasil.
Yggdrasil, in fact, now seemed so central to the worlds that without it they would all be destroyed.
The Youngest Realm
Each of the sons of Borr reacted in his own way to the realization that forces, previously unnoticed, were changing the universe around them.
Odin wandered for a time, seeking knowledge. It was in these wanderings that he met Loki.
Ages passed, Odin became Allfather. The Aesir and Vanir went to war, then reconciled. Loki became a mother and a father.
It was one of children that Loki fathered by his jotun wife, Angrboda, that created the final realm.
It had been noticed that inhabitants of all realms went to Niflheim when they died, and the question of what to do with the dead had never been answered. Odin and Freyja, a Vanir who lived in Asgard after the war, had worked to divert those who died in battle to their own halls, but for those in Niflheim there was no order, oversight, or structure of any kind.
When Hel, Loki's daughter, was abducted (along with her siblings) by the Aesir under order of Odin, Odin sent her to the part of Niflheim those who died outside of battle resided in, and gave her authority over those dead.
Hel built her kingdom with great walls and dwellings, and made it unlike Niflheim through her efforts. Eventually it became so different that it split from Niflheim and became a world unto itself.
The Evolution of the Realms
As time wore on many new gods were born, some forming their own communities outside of Asgard's walls.
A group of these gods claimed to be messengers of a greater god, one more powerful than and older than the Aesir and the Vanir and more knowledgeable than the Allfather. They claimed that neither they nor other gods were really gods, and this caused great friction between themselves and the other communities.
Eventually they exiled themselves to Niflheim, the one place none yet lived, and their subsequent isolationist policies allowed them to convince themselves that there were no other gods.
They were able to pull an ever growing portion of the dying away from Helheim and back to Niflheim, which they renamed "Heaven".
More ages passed and the inhabitants of Niflheim went to war with themselves. The battles spilled out of Niflheim, over Alfheim, and finally ended with the losing side being banished to Muspelheim, where they vie for dominance with the Eldjotuns to this day. The winning side of the war in Niflheim were somehow able to redirect dead they considered undesirable to Muspelheim.
- - -
Ok, so, how this fits into the wider setting.
Using the terminology from the post where Sam described the setting, we have this mapping:
Primary (stable) worlds:
Midgard = Earth
Asgard = The God's Domain* (this includes outside of the walls of Asgard)
Muspelheim = Hell
Niflheim = Heaven
What Sam calls "ancillary dimensions" rather than "true realms":
Ljosalfheim = The Battle Plains
Svartalfheim = Limbo
Jotunheim = Purgatory
Vanaheim = Omen
Helheim = Revelation
The Bifrost = Dreamscape
Yes, The Battle Plains does have a large elf population. Yes, Limbo does too. Sam's terminology doesn't distinguish between Vanir, Aesir, and jotun. They'd all be classified as "god".
The Eldjotuns here, though, are pure outsider and as such Sam would be a hell of a lot more comfortable with a story that explicitly said, "No, they'd not related to the other jotuns in a meaningful way. Don't even try to make a connection sons of Borr. You can't connect Surtr and his ilk to people like Loki and Skaldi. These are very different species."
Sam has no problem with the Vanir appearing in Vanaheim/Omen without explanation. As far as Sam is concerned no one knows how the Aesir got in Asgard either. Sam doesn't do origin stories.
If you tell this story to Sam he'll be quick to point out that you never explained where figments and elementals come from.
Sam does not rule out the possibility of a cosmic cow, but will wait on confirmation.
* Needs a new name but given that it houses the vast majority of pantheons, it's hard to come up with just one name for the whole place.