When I create a world in minecraft, I usually make a farm with Tamed dogs and cats, as well as Cows, Sheep, Pigs, Chickens, and Mooshrooms. However I keep them contained with a fence. But sometimes they glitch through it, and end up on the other side where they run off.
This happened to me with villagers... really annoying!