I was reading wikipedia about a ship and it it's always refered as female. Is it unique to ships? I've learn in school that words in english does not have a sex, you can call a cats and dogs as "it".
The boat is not female in itself. You are correct that the English language does not have a grammatical gender (mostly).
If you have a look at this blog there are several reasons offered for why people use female pronouns when referring to ships. I cite the most reasonable below.
One prosaic explanation is that the gender of the Latin word for “ship” — Navis — is feminine. But people generally agree on the more romantic notion of the ‘ship as a she’ phenomenon: that it stems from the tradition of boat-owners, typically and historically male, naming their vessels after significant women in their lives — wives, sweethearts, mothers. Similarly, and more broadly, ships were once dedicated to goddesses, and later also to mortal women of national or historic significance, thereby bestowing a benevolent feminine spirit on the vessels that would carry seafarers across treacherous oceans. Figureheads on the prows of ships were often depictions of such female namesakes, denoting the name of the ship for a largely illiterate maritime population.
EDIT: Regarding the warships there are comments under the blog of self-professed sailors and navy personnel (I can't vouch for that) who express the following:
In my sailing days it was explained to me that women carry life. Any vessel that can sustain life in an environment that people could not normally sustain life functions without her body should, appropriately, have a feminine name.
A X-USN Vet., I understood the same as Carlos [the other commenter], like the womb, protecting her child from an uninviting environment. Until we set sail back to shore. Thanks Mom!