Housebreaking is a dog skill in The Sims: Unleashed and a behavior in The Sims 2: Pets. Much as in real life, a Sim housebreaks a Sim dog by scolding it for relieving itself indoors, and praising it for relieving itself outside.
Cats do not need to be housebroken and will automatically use a litter box provided that the litter box is kept clean and that they can get to it in time. In Unleashed, cats cannot be housebroken. However, in The Sims 2: Pets, cats will learn the "Housebroken" behavior if they are praised for using the litter box. While this is not necessary, players may wish to do it for verisimilitude. However, some stray cats may start out so "Yardbroken" that they avoid the litter box, but scolding them for not using it will eventually overcome this. Also, cats in The Sims 2: Pets can be trained to use a toilet; cats who have been so trained can and will use a toilet spontaneously.
In The Sims 3: Pets, praising a dog for relieving itself outside will help train it to develop the Neat trait. While this is not called housebreaking, a Neat dog should tend to go outside when it needs to relieve itself.