It’s likely that reports of wildlife crawling up through the sewer system are highly exaggerated. Many small critters manage to enter a house through an unprotected vent, crawlspace, or other void in the structure. Once inside they seek water because they’re thirsty, and the only standing pool of water in most houses is the toilet. When the resident discovers the critter in/near the toilet they assume it came in through the plumbing.
If you understand the basics of a residential sewer system, it’s easier to see that it’s possible, but quite unlikely. Most waste stacks (the main drain of the house that takes the waste out of the house to the sewer or septic tank/field) have at least some amount of vertical run because they are gravity powered. For example, a bathroom on the first floor may have an eight foot run to the basement where it exits the building. Contrary to popular belief, this sewer line is empty most times, except when a faucet is being used or toilet is being flushed, etc. so it’s not a matter of a rat or snake “swimming” up the pipe. In reality, a rat would have to somehow enter the sewer system outside the house, climb the interior of a slippery and sludgy 4” pipe going straight up for a story or more, make it’s way through a tight P-trap, and end up in the toilet bowl. Not to mention, if someone flushed the toilet it would send the rat outside along with the contents of the flush.