I'm remembering an anthology TV series that I probably watched sometime in the mid to late 90's (though I wouldn't exclude the early 2000's) in America (English), and it was most likely intended for children or young adults.
The setting is somewhat ancient, like a story you might imagine from the Old Testament in the Bible. From what I remember, a young man lives in a place with a forbidden door that his father(?) tells him he should never enter because there's no way back. For some reason (curiosity? discontent?), he decides one day to go through it and ends up walking down a long dark tunnel. There may have been some giant or man in the tunnel he has to get around, but I could be remembering that part wrong. Afterwards I'm pretty sure he wakes up in a desert, where he's rescued by some travelers who bring him to a place where he is well cared for, and generally the world seems to be better than his previous life.
This place has a forbidden door of its own though, and given how well it turned out last time, he goes through again. This time, however, he's not so fortunate. I think he wakes up in a desert again, but overall the world is less welcoming. He may or may not go through this world's door again, but the outcome is never good.
The story essentially has a moral attached to it of appreciating what you have because trying to go for more means you could end up losing it all.