Thank you for your question about how we refer to animals; a subject that is always dear to an English person’s heart.
As you mention in your question, we can use ‘he’ or ‘she’ to refer to an animal that is a pet. In fact, we nearly always do this. Not only do we use this when the animal is our own pet, but also when we meet someone else’s pet for the first time. For example, if I meet a dog in the park, I will probably ask the owner, “What a lovely dog, how old is he?’ I say this even if I am not sure if the dog is a boy or a girl because it would be rude to say, “How old is it?”
So, what about when we refer to wild animals? I think that in general we usually use ‘it’ as the pronoun for them. For example, you are walking in the countryside with a friend. You see a wild deer and point it out to your friend, ”Can you see that deer? It’s under the big tree over there.”
However, there are times that someone might use ‘he’ or ‘she’. For example, if you watch a wildlife show, it is likely that the commentator will refer to an animal that is featured in the programme as he or she. Equally, in a work of literature the writer might refer to an animal that is a character in the story as ‘he’ or ‘she’. The great novel ‘Tarka the Otter’ by Henry Williamson is a fine example of this choice of writing style. “The otter gave but a glance to the bird; she was using all her senses to find enemies.”So, why do we use ‘she’ or ‘he’ to refer to animals? Simply, it acts to personalise the animal. Therefore, you can choose to use ‘she’ or ‘he’ as a pronoun for an animal be it a pet, a working animal or a wild animal. However, while this is an everyday style when it comes to pets, it is more likely to be a literary style when it comes to wild animals.