As TwitchPlaysPokemon taught us, it is possible in early generations to release pokemon with critical HM moves, making it possible to permanently 'lose' the game.
However, at a certain point in the series, you could no longer release such a pokemon, presumably to avoid getting 'stuck' in this manner.
When in the series was this rule of not being able to release an HM-knowing pokemon implemented?
Best Answer
This feature was implemented in Gen 3 (NOT Gen 2). In fact, you can find videos online of people getting stuck in Cianwood by releasing all their Surf-capable pokemon, much like Cinnabar in gen 1. I have also personally tested this on a real Game Boy.
Note that due to an oversight, it is possible to get stuck in D/P/Pt by trading away your Finneon to Meister if it's your only pokemon that knows Surf. You still can't release them though.