Ships in ports of call are subject to the laws of the country of the port, as well as the same laws when in territorial waters. That's Maritime Law. Many Counties do not allow their citizens to own firearms privately, nor do they allow visitors to bring them into the country. A ship arriving in a port is different from an air-craft landing at an air-port in which legal respect?
Many countries will actually seize a ship for such matters, and it's cargo. Ships are not diplomatic areas, where the status is conferred upon them of sovereign territory. That would be a HUGE mistake.
The mention of the Turkish ship wasn't a reference to the Merchant marine, just to the fact that Turkish ships tend to employ the less-disciplined sailors of the various groups. Today, most crews are multi-national. Some companies vet them, others are a little less worried about the character of their employees, and problems in ports.