Typically, it is specialized roles and setups that create a truely confirmed townie.
Examples:
For a while, the Paranormal games had a role that could bypass all tricks and truely read one person's alignment. That person would then claim then request to be killed. Killing them confirmed that they were that role and were town aligned, making the claim 100% true. If the claim was that someone was a townie, that person would be a confirmed townie.
In bay 12 mafia, there was a one shot day killer and a resetter. The day killer could, of course, kill someone, which then showed their alignment. The resetter could, when lynched, reset the entire day, nullifying everything that happened before including their own lynch.
Thus, the day killer killed someone that flipped town, then the resetter was lynched to reset the day, nullifying the kill. The townie was alive again and, since we knew their alignment, was a confirmed townie.
(note, the resetter turned out to be scum. Also, the town grew so reliant on the confirmed townie that they failed to scumhunt. The town was eventually slaughtered)
In Kingmaker games, there is a Kingmaker role that can ONLY be given by a townie. Thus, at the start that person claims. It's foolish for scum to counter claim since the town will just lynch one then, failing to pick correctly, lynch the other. The town can do that wilingly since a new kingmaker is picked if the old one dies. Result, in Kingmaker, there will always be a confirmed townie.
Note: The presence of the confirmed townie in this case helps the town but doesn't break the game, especially since the most critical role: King, can't be held by the confirmed townie.
Hosts work pretty hard to either eliminate the chance of a confirmed townie or soften their influence. Left unchecked, they can-at best-lead to a quick win and-at worst-lead to a VERY boring game.