You may find yourself living in a shotgun shack And you may find yourself in another part of the world And you may find yourself behind the wheel of a large automobile You may find yourself in a beautiful house, with a beautiful wife You may ask yourself, "Well, how did I get here?"
In Gosick, Kazuya and Victorique end up on a ship that's pretty mysterious. Although they DO know how they got there (from a ticket given to a dead woman they didn't want to let go to waste) in flashback scenes the original children sent to the ship 20 years earlier was very much an Ontological Mystery. For Victorique it's solving the mystery AGAIN in order to survive.
Haibane Renmei: the precise nature of the town of Glie is left mysterious throughout, and although there is a way for the Haibane to leave, it's never clear where they go or how, leading to speculation among fans that Glie is an allegory for Purgatory, or that it IS Purgatory.
Fleep, possibly the ultimate Ontological Mystery; one person, in a phone booth, sealed in concrete.
Final Crisis Aftermath: Escape has a number of characters from The DCU's espionage community trapped in a dreamlike "Electric City" with no idea how they got there.
The first Saw movie. In later movies it is already established who is behind all of it, although the Ontological Mystery still applies to specific (groups of) characters.
Identity: All the guests are trapped in the motel during a bad rainstorm that knocked out the power lines, ensuring that no one can call for help. The ontological mystery part is, that everything is happening in the mind of a single person who suffers from multiple personality disorder (each of the ten guests represents one personality).
Mindhunters has definite shades of this. The characters do know why they're on a secluded island: as part of an FBI profiler training exercise. It doesn't take long before they're completely cut of from the outside world and it turns out that there's a killer amongst them who starts murdering them one by one.
Memento has the protagonist (and the viewer) in a constant state of ontological mystery due to his ongoing amnesia.
Exam has the characters at a job interview in which they are presented with a 'test' that turns out to be a blank sheet of paper. They have to work out what the problem is then solve it, and they're all rivals for a highly sought after job. If any of them leave the room, they lose the chance. It gets LOTS worse...
Nine Dead. The protagonists all wake up in a cell chained to a wall. Their captor tells them that one of them will die every ten minutes unless they can tell him why they are there.
Captivity, a 2007 thriller film starring Elisha Cuthbert.
For Inception, one of the clues that you're in a dream is when you can't remember how you got to where you are.
Literature
In the H. P. Lovecraft short-story "The Outsider" a man has lived his whole life in a dark castle beneath an all-enclosing forest that blocks out the sky. Yet, he feels strangely that he has not always been there...
In William Sleator's House of Stairs, five teenagers wake up in the titular House of Stairs. It's a giant complex of interlocking stairs and platforms, but none of the stairs lead out, they only connect to other parts of the maze.
Issola: A couple of people our hero considered completely indestructible have gone missing. Not even Sethra Lavode, who very much deserves her Shrouded in Myth status, can find them by herself. She, does, however, know how to get Vlad there, and he arrives to find his two incredibly Bad Ass friends stuck in apparently unbreakable, seamless chains in an empty room with no exits that appears to be on another planet. The plot hinges on figuring out how the hell the bad guys managed it, and why.
Minotavr (Minotaur), a Russian novel.
The Helmet of Horror by Victor Pelevin. Several people wake up in rooms connected only by a chat-like computer system; each room opens into some sort of labyrinth. Some labyrinths are real, some metaphorical, and one is accessible only through dreams.
In the Dungeon series, beings from all times and spaces are brought to a nine-leveled artificial prison called the Dungeon. At no point in the series is the Dungeon's origins, masters or purpose made clear, only speculated on.
Illium by Dan Simmons comes close, even though it spans three planets rather than a room. The mystery is just what has happened between our time and this imaginary far future to make the latter so bizarre. For a start, where did all those Greek gods using advanced technology and living on Mars come from? The characters on Earth in particular take their condition as a mystery to be solved and try to escape the definite confines that are set upon them even as they are able to teleport around the world freely.
Someone must have been telling lies about Joseph K., he knew he had done nothing wrong but, one morning, he was arrested.
And he never does find out what he's supposed to have done, either.
Actually, it's a subversion, because at the end he finds out that he is guilty of life and original sin, which is by nature inescapable. Once he realizes the nature of his crime, he submits willingly.
Also by Kafka, The Castle. A surveyor is summoned to the town surrounding a tremendous castle of Obstructive Bureaucrats, and nobody is sure why; the hero thinks he knows who he needs to talk to so he can find out, but first he has to get an appointment with the undersecretary and convince him to give him an appointment with the regular secretary...and so on. He is also inexplicably appointed two childish assistants that mostly just make fun of him. The book was never finished, so it's not clear if there ever was an ending.
The Maze Runner has the main protagonists trapped in a maze. The sequel, The Scorch Trials, is about them trapped in the deserts of a future Earth.
One of the many themes in House of Leaves. It's also arguably one of the less Mindscrewy themes, which should give you some idea of what the book is like.
Live-Action TV
Both Buffy and Angel did this in one episode each: "Tabula Rasa" for Buffy and "Spin The Bottle" for Angel. In both cases, a spell intended to affect memories went wrong and resulted in the entire main cast losing their memories. In "Tabula Rasa," they got complete Identity Amnesia. In "Spin The Bottle," they got Identity Amnesia removing all memories since their teenage years, which still complicated things because they each spent their teenage years very differently. Especially the 200-year-old vampire. In both cases, there were many logical but amusingly wrong deductions made about what was going on before they managed to undo the spell.
"The God Complex" with a nightmarish hotel that has a room for everyone, is a very straight example. The Doctor even lampshades it.
The Doctor: Big day for a fan of walls!
"Amy's Choice". The Doctor, Amy and Rory find themselves being transported between two realities, forced by the Dream Lord to choose which is real and which is a dream. When the Doctor realizes that the Dream Lord is a manifestation of his own dark side and can manipulate events in both worlds, he correctly concludes that both scenarios are dreams.
Part of the premise of BIONICLE. Although the characters themselves don't ask questions relating to how they, a bunch of sentient cyborgs, came to be living a primitive lifestyle on a tropical island , Word Of God has stated that this was a major source of the series' appeal in the early years, as the viewer would be curious as to how this situation came about. The Matoran were unaware that they were suffering from mass amnesia, so they were just as surprised as the viewers were when their origins were slowly revealed over the next few years of storyline.
Video Games
An entire genre of web games, the "escape-the-room game," is based on this, with the player being trapped in a room and having to search the whole place for items in order to get out. It typically starts with some Easy Amnesia to explain why the player doesn't know how they got into the room. Examples include Crimson Room and its sequel Viridian Room, and Mystery Of Time And Space.
Countdown by Access Software (released in 1990) opens with the protagonist waking up in a mental asylum without memory.
Myst is probably one of the most famous examples of this. Interestingly, the rest of the series avoids the trope except for End of Ages.
Only because you know where (if not who) you are from the first game.
Planescape: Torment can be seen as an example of what happens when someone makes a 50+ hour epic out of this trope.
The Neverhood begins with our hero Klaymen trapped in a room (see above) with no information, and goes from there.
eXperience112 (The Experiment in America), the player is trapped in a control room with no memory how he got there. Notable in that you do not leave the room - you use its controls to manipulate another character into solving puzzles for you.
In Eternal Sonata, Frederick Chopin views all of the events that transpire in the game as nothing more than a dying dream. Finding out whether or not that's true is a major element to the story.
the white chamber: You wake up in a coffin on a space station. You can leave, but you'll die of asphyxiation.
Theresia for the DS fits this perfectly, with the main character slowly regaining her memories throughout the game, and the house is filled with deadly traps.
Silent Hill 4: The Room - the only chapter in the series in which the protagonist didn't willingly enter.
The beginning of The Legend of Zelda: Majora's Mask certainly qualifies. Link is sent into a parallel world after being transformed into a Deku Shrub and finds himself in the middle of a strange town, unable to escape because there are guards in every exit blocking his path. He needs to find out exactly where he is, what is going on and how to return to normal in three in-game days' time before the world ends. Afterwards, the game starts to play like a regular Legend of Zelda game.
The prologue of Amnesia The Dark Descent. The rest of the game is about rediscovering your past identity and past actions. Which are far from pleasant.
The goal in Rule of Rose is to learn of Jennifer's past and come in terms with it, making it a straight example of this trope.
Nine Hours, Nine Persons, Nine Doors: You wake up in an early 20th century 3rd class cabin, in a flooding ship, actually, a recreation of a flooding ship, and must escape in under 9 hours (through a mysterious "Nonary Game"), after which the floodgates will reopen and the ship will do its submarine impression. The same goes for the sequel, Virtues Last Reward. You wake up in a mysterious facility, which turns out to be a base on the moon, and are forced to play the "Nonary Game: Ambidex Edition" in order to escape.
Submachine, a point-and-click adventure series has, since 2005, captivated audiences with its infinite layers of complexities and strange dimention-warping room-escape-esque games.
Even when in a literally infinite open space, you still cannot escape.
In ATLUS' game Catherine every one of the sheep in the Nightmare World start off completely oblivious, including Vincent. Many conversations on the landings involve trying to discover who the rumored witch is, why they are there, and whether or not there even is an exit. The only sure exit from these nightmares is death. The trials themselves are highly symbolic of maturity, dealing with Vincent's unwillingness to take responsibility.
Second Sight The player character wakes up in what looks like a hospital room with amnesia and is trying to find out who he is and why he is there.
Lifeline begins with your character mysteriously waking up in a space station's control room after a monster attack, not knowing how he got in there or where his girlfriend is, with his only link to the outside world being a cocktail waitress named Rio.
The Starship Damrey, for the 3DS you wake up from Cold Sleep with amnesia, you can't get out of your box, and you need to explore the eponymous ship using remote controlled robots. It uses a lot of Nothing Is Scarier
Webcomics
The Ends has as a central plot element the question of whether the inhabitants really exist or are simply living out a self-inflicted hell created when they blew themselves up in a nuclear apocalypse.
Blank It takes place entirely in this scenario, with the two main characters appearing unexplainably in a blank white void.
Problem Sleuth starts off in a rather simple locked room version of this, but rapidly grows to encompass an imaginary universe, demonic mafia kingpins and a army of courtesan angels. In the end however, the main character goal is to escape the office building they start off mysteriously trapped in and reach the streets of the real world.
Homestuck: A young boy starts a multiplayer video game and finds himself and his house are suddenly Trapped in Another World, while back on Earth meteors are destroying civilisation. That's only the beginning, however...
The base plot of many a multifandomroleplay, often nicknamed 'spooky jamjar games'. The setting is a 'spooky jamjar'.
The blog Ontological (part of The Fear Mythos) begins when the main character wakes up in a house without doors...instead all the windows and places where the doors should be are bricked up and he is unable to escape.
All three games on Addventure begin with the protagonist finding himself in a void or in a strange room.
Western Animation
Twelve Ounce Mouse (Possibly... who really knows what that show is about?!?)
As near as can be said with any certainty, the character Mouse himself almost definitely realizes he is one personally when memories of appears to be a wife and family prompt him to reflect that he really doesn't remember anything from his own past much before the series.
In My Life as a Teenage Robot, the "Enclosure of Doom" episode starts with Jenny and Killgore regaining consciousness inside a high-tech structure, complete with Death Course, with no idea how they got there. It turns out they're trapped inside Armagedroid, Killgore's Humongous Mecha.
The plot of the 2007 The Simpsons episode "Eternal Moonshine of the Simpson Mind." Homer spends the episode trying to regain his memories of the previous night. Invoked Trope because Homer accidentally learned about a surprise party the town was holding for him, and asked Moe to concoct a Gargle Blaster that would un-spoil the surprise for him.
Other
The "amnesia game" is one of the most common types of theatre-style live-action roleplaying games. Only the Deadly Decadent Court is definitively more popular.