An aframax tanker lost control and hit the side of the dock in the Brazilian port of Santos, damaging three naval ships.