I don't interpret OTGW as a dream though. I see it as them being so close to the transition point between life and death, as lost souls fighting to come back and the hero's journey let's them discover things about himself and overcome his anxieties.
The Unknown exists outside of time and space similarly to the Black Lodge. That's why each episode and characters are from different periods. It's how he can interact with Endecot when you see his grave in the present. And Wirt even says the 2 houses have different interior design styles.
Comments
The none dream segment of MD is very similar, lien you see the Cowboy at the party