Tolkien was working on something like this; he called it a mythopoeia - in basic terms, he created a world and an entire backstory, history, mythologies and legends which had nothing to do with the story he was trying to tell or characters he was focusing on; then he put the characters in that framework and had them react to the world he created as opposed to create it around them.