Most people would use he or she to refer to a pet (or any animal in which the gender was known).
I would never call my cat an "it." He is, in fact, at this very moment, lying across my forearms while I type.
But if you know the sex of the animal, use it. "The mother bear was very protective of her cub. She kept a sharp look out for possible threats." It would sound awkward to say "The mother bear was very protective of its cub. It kept... etc."
On the other hand, a squirrel in the yard isn't going to be flashing you, so you can say "Look at the squirrel - it's so cute."