If Mario ends up inside a block (usually as a result of sliding, jumping, or swimming from a crouched position while Super), the game will push you to the right until you're outside the wall. Usually, this is enough to prevent you from getting trapped; however, if you do this at the end of one of the underwater stages (2-2, 7-2, or the optional underwater section of 6-2), you'll get pushed forward to the edge of the screen and be unable to escape. Later versions of the game (such as Vs. Super Mario Bros and the All Stars remake) usually add a block above the ending pipe to prevent this from happening.
Super Mario Bros.: The Lost Levels
If you go to an underground bonus room in World 3-1, you'll come out of a pipe below some blocks that you must break to continue. Since only Super or Fire Mario (or Luigi) can break blocks, there's a hidden block with a power-up. However, if you pick up the power-up and then get hurt by the nearby Piranha Plant, you won't be able to get out.
C-3 and D-2 both have massive jumps that can be cleared only when Mario jumps on a springboard. Sometimes, these springboards fail to spawn due to sprite limits.
Also happens in the original SMB. If you jump into where the springboard would be, you get stuck until the timer runs out.
Super Mario Bros. 2
One could make the game unwinnable by crouching and sliding into a passage of only one-block height. Since the player can't auto-slide out as in the rest of the games, the character gets stuck permanently; since there's no time limit, you will have to use the suicide code or reset the game and start again. The Super NES All-Stars version fixed this so you can attempt to duck and jump whilst pressing left and right.
In the PRG0 version of the cartridge, if you get hit by one of Fryguy's pieces while throwing a mushroom block at another, that piece will be thrown off the screen rather than disappear, and the game will register it as still alive, so the exit door fails to appear. The only way out is to reset or use the suicide code (Up+A+B on the pause screen).
The players with OCD who must dig out every block of dirt in the pyramid levels can get themselves trapped in the left side of world 2-2.
After Wart is defeated, scrolling gets disabled, so if you're too far to the left, you won't be able to enter the door under where Wart was standing. What's worse is that you can't die if this happens. Even worse than that, this error was not fixed for the All-Stars version!
Super Mario Bros. 3
A glitch can cause the game to be unwinnable. In World 5, it is possible for the airship to land on the land-based portion of the map, displayed in miniature in the upper left corner of the sky map. When you then chase it down to ground level, it's nowhere to be found. This would be a good airship to use an anchor on if you've acquired any. Fortunately, it is also one of the easier airships.
If you're really unlucky, then you can trigger an N-spade to appear on top of a Hammer Bro, causing this to happen.
An example thankfully restricted to one level - in World 7, one level has a Hammer Bros. Suit in it (other than this one, they're only available as world map items found in mushroom houses). If Mario is in statue form from the Tanooki Suit when he grabs it, he becomes a greyscale version of the usual Hammer Bros. Suit that can't use the pipe needed to continue the level. Fortunately, this only makes it impossible to clear that level on that life. This was corrected in the SNES and GBA remakes.
One fortress requires you to obtain a Tanooki Suit (if you aren't already Raccoon Mario) from a secret room accessed by P-Switch. If you trigger the switch but for some reason let it time out before you reach the bottom of the room, it's Lost Forever and you can't beat the level on that life. A similar situation can happen at the end of the World 8 fortress, where the boss door is triggered by the switch. In cases of really bad timing, you can get entombed in the blocks until time runs out.
A mistake of Galoob rather than Nintendo, there was a set of Game Genie codes for the NES version that allowed Mario to be, and remain, in a certain suit. However, these codes overwrote additional data that was part of the door animation after the final fight with Bowser, causing the game to freeze if you did not enter the door immediately. The Game Genie code book warned the player to enter the door immediately, or else they would be "caught in Bowser's Time Trap, and the game will pause forever!"
In World 7-5, there's an area where you fall into a room where the way out is a one-square-high gap to slide through (if you're big) or walk through (if you're small.) If you enter wearing a Frog Suit and don't keep one of the Bob-Ombs to deliberately get hit and therefore get rid of the Frog Suit, you're stuck and have to wait for the counter to fall down.
In the room before the Bowser fight, you can crouch and fly into the gap over the Bowser statue to slide through the wall, leading to different layouts of the boss fight. You can do this a couple more times before you are permanently stuck inside the blocks and you have to time out to continue.
Mario & Luigi: Superstar Saga
When you hammer Luigi into a slot on the beach or on the Oho Jee and Oho Jee mini-game islands, Luigi becomes a surfboard for Mario to ride. However, if you slide onto the beach and an enemy runs into you, just as Mario jumps off Luigi for Luigi to become normal again, both will be frozen in that position once the battle finishes and you have no choice but to reset due to the glitch.
Luigi's Mansion Dark Moon
Happens in many, many ScareScraper games, mostly because a necessary key fails to spawn due to a well known glitch and the ghosts you need to defeat are on the other side of the door.
Also seemingly happened to some poor soul who saved and quit between the Tough Possessor and King Boo battles. The game counted the former as complete, but not the latter, meaning that whatever he did, the game would never progress to the final boss. Hear about this tale of woe here