Do you mean in Ocho Rios? It is safe in the immediate area - to include the Taj Mahal shopping plaza and Island Village, which are just a brief walk away from the pier. The worst you will encounter are some panhandlers and taxi drivers but they are not allowed inside the above two places and I just say no thanks and keep walking when these guys approach. The port police have cleared out the zone by the pier and it is pretty much a no-man's land until you get to the main street, and by then you are just a few feet from the shopping plazas.
Montego Bay is another story. I wouldn't walk away from the pier area there.
Island Village is nice, although not especially Jamaican. That is where Margaritaville is located.