Unlike most other European languages, Modern English has no grammatical genders. When we speak about an inanimate object, we always refer to it as “it”. For example:
Although animals are animate, an animal is also traditionally referred to as “it”, unless you want to emphasize its sex or your personal relationship with it:
In this case, since the animal’s sex doesn’t matter and we have no personal relationship with it, we use “it”. Note, however, that it is customary to refer to all animals as “he” or “she” in certain circles, especially among animal rights activists.
Nevertheless, most people would use “he” or “she” (depending on the sex of the animal) only when referring to an animal with whom they have a close personal relationship:
Both examples are grammatically correct, but the first one sounds more affectionate.
Sometimes things are referred to as “she” to show affection. It is traditional for ships to be a “she”:
Nevertheless, it is not wrong to refer to a ship in an impersonal manner as “it”. Similarly, countries and cars are sometimes referred to as “she”:
However, don’t overdo it. Even if you really love your Ferrari, referring to it always as “she” may make you sound pretentious or snobbish (if the mere fact that you have a Ferrari didn’t do the job).