As previously said, it is not prohibited but requires some care. Commonly used stainless steels suffer the crevice corrosion. It is a situation where a metal is in contact with an electrolytic conductor (like a screw inside a wet wood), which separates it from a direct contact with the air. The electrolytic medium will create areas of locally dissimilar concentrations of oxygen in contact with the metal (so-called "differential aeration cells"), which in turn creates a difference in voltage between dissimilar areas. Kind of like putting zinc and steel adjacent to each other, in a wet ambient.
AISI 304 (or grade A2) fasteners are the worst performers in these conditions, and are imo out of consideration for use in naval constructions. The AISI 316L (grade A4) fasteners perform much better, but still require attention to following steps:
1) The wood has to be dry (max 10%-12% humidity).
2) Each screw requires a pilot hole to be drilled first, each hole then soaked with epoxy. Besides isolating the screw from water and humidity, soaking the pilot hole with epoxy will considerably increase the grip and the fastening force of the screw.
3) Finally, the hull has to be completely encapsulated with resin, in order to isolate it from both the water and the air humidity.
An even better and more reliable choice would be the Duplex steel fasteners (like 2205, or grade FA) which have very good mechanical properties (yield strength typically 2 times higher than the 316L) and are much more resistant to crevice corrosion than the AISI 316L. It will cost somewhat more than 316L, though.
Cheers