" laws ...in reference to firearms on board,"
There generally are none. "On board" is just another place, the same as any other place, as far as almost all firearms regulations
are concerned. Same as your car, your office, or your school
bus, covered by the same regulations.
Until you get into the realm of specifics between nations and navies, i.e. "I can neither confirm nor deny the presence of nuclear weapons aboard this ship."