In Sam & Max: Freelance Police episode 302: "The Tomb of Sammun-Mak", reel 3, despite Jurgen being on the other end of the train, or several trains away, despite being able to look around the rest of his room with impunity, if you try to touch his steamer trunk without turning him into a vampire first, he will immediately burst in and yell at you for it.
The shopkeeper in The Secret Of Monkey Island will appear in his shop instantly if you try and steal something, even if he was on an errand.
Except for the scene where you break into his safe.
In Zork I, as soon as you enter the thief's lair, "You hear a scream of anguish as you violate the robber's hideaway. Using passages unknown to you, he rushes to its defense."
Old school text adventures in general were big on this — the emphasis on Trial-and-Error Gameplay and importance of the verb "take" made it necessary for game designers to go the extra mile in those rare situations where kleptomania was not the answer. Another example would be Wishbringer, from the makers of Zork, which had a card and novelty shop where touching anything would summon the owner from an adjacent room.
In Warnings at Waverly Academy, Nancy Drew is undercover as a student at a girls' academy in upperstate New York. Said academy has a 3AM curfew. No matter where Nancy is at 3AM, even if she's downstairs in the completely empty basement with the lights off, out of the door's line of sight, she'll hear the hall monitor start screaming at her.
in Duke Nukem enemies would literally teleport out of thin air when the player walked over certain spots. This meant that judicious use of the jetpack could prevent a large portion of the level's enemies even appearing.
Role Playing Game
In Pokémon Yellow, at the beginning of the game you are given a table with a Pokéball, as soon as you try to pick it up, your rival pushes past you and grabs the Pokéball for himself.
The city guards in The Elder Scrolls games play this straight, sometimes to ridiculous levels.
The guards in Daggerfall will appear out of nowhere even in the middle of the night if you steal something or otherwise do something wrong, accompanied by the Most Annoying Sound.
The guards in Morrowind aren't much better. You can steal something or kill someone in one town, then use a teleport spell to zap to the other side of the island. And, sure enough, the guards there are ready to arrest you as well.
The guards in Oblivion will remember if you have evaded arrest before, even if you hoof it to an entirely different town. News Travels Fast, after all.
Skyrim tracks each hold's bounties separately, and unless it's really high (say, 1000) the guards within a hold won't immediately arrest you. They will, however, mutter that they recognize you from somewhere, then remember it was a wanted poster if you talk to them.
In one house in the original Breath of Fire, there was a chest that could not be opened no matter who was in your party, because you would always be caught in the attempt, arrested and thrown in a Cardboard Prison.
In Fallout: New Vegas, your Reputation drops if you kill someone belonging to a faction, unless you are stealthed and use a silent weapon. Killing certain major NPC's automatically earns you infamy regardless of whether you are in stealth mode, and may make that faction permanently hostile. If the offended faction happens to be the NCR or the Legion, they will also spawn hit squads at certain points on the map. Fallout 3 similarly had Regulator (for Evil karma) and Talon Company (for Good karma) squads, although their appearances were somewhat randomized.
Justified in Megaman Battle Network 2. Lan and Megaman are sent to retrieve the Chng.bat program from a foreign network. Upon arriving and taking the program, they trigger a security system which spawns a series of powerful viruses to prevent you escaping with it.
In The Sims 3, teenagers can be arrested for breaking curfew. Or rather, they will be arrested for breaking curfew, because cops will automagically appear to arrest them at the stroke of midnight if they're off lot, even if they're inside. The modding community generally refers to these cops as the 'psychic curfew police' and has devised various patches that reduce or eliminate their psychic powers.
Resident Evil 4 has a seemingly unguarded treasure chest in Chapter 3-3. As you approach it, a cage drops around you, Zealots fill the room, and a Garrador jumps in for a cage match.
In the Star Trek Deep Space Nine game The Fallen, Major Kira is at one point tasked with infiltrating a secret Cardassian base and does so disguised as a Cardassian scientist. She cannot use any weapons, up to and including her fists, until she's entered the base proper. Even if she stands completely unseen in a remote corner and punches the air once, she'll promptly be attacked by guards while an alarm starts screaming in the distance. Oh, and the base's PHASER CANNONS will start shooting at her even though they're triggered only by sight.
Wide Open Sandbox
The prefects and the police in Bully will come after you for attacking a small child, a girl, or another authority figure, even if you're not in their line-of-sight.
Being caught in the act of murder, petty theft, pickpocketing, or burglary in a Fallout game will instantly turn the entire settlement hostile, at least for a few days; some towns, like Paradise Falls in Fallout 3, will become permanently hostile.