Delayed battle glitch (Generation I)
It is possible to escape a Trainer battle by getting a wild encounter on the same step as where the Trainer sees you (in a cave or grass) and then fainting on the wild Pokémon. This can either do something like restart the Trainer battle after you are whited out, or it can be used as an alternative version of the Trainer-Fly/Ditto glitch (e.g. by fainting before a Bug Catcher in Viridian Forest).
This original fainting trick was found by Vimgur, where it's actually the only known way to get level 100 Pokémon before Brock in Red/Blue as opposed to Yellow (briefly you faint before the Bug Catcher, encounter a Trainer e.g. Gary, then a Pokémon with a special corresponding to the medium slow growth algorithm like Nidoking and use Growl six times on it, return to Virdian Forest and catch it, then gain less than 54 experience on the level 1 Pokémon to get it to Level 100)