Could be a movie, could be a twilight zone episode, I don't actually remember. I saw this when i was a kid 10-15 years ago.
Story starts off in a rural suburban town out in the middle of a desert or something like that. I'm pretty sure the main character was male, but I'm not even really sure about that. He starts to see through the virtual reality simulation. I remember, at one point, he looks around and every thing is in ruins, the people are old and disfigured. One of them thinks they are eating bagels, but it's actually crackers in a box labeled bagels.
Fast forward, he's traveling to the big dome city supposedly controlling the little town he's in. Something happens on the way there, not clear what. Then he gets to the city. It's a big biosphere type city. He runs around like an idiot for a few minutes, and find the big computer controlling the simulation in his hometown. Then he looks around and notices that this big dome city is under the same illusion. They are actually living in a simulation as well, while thinking they are the ones controlling it. Everyones wearing tattered and torn robes and whatnot.
At some point he find himself in a room with this old guy. Everyone is in pods. Something happen, then the movie ends with him walking out west into the mountains while the simulation has been dispelled for everyone.