Yes you can safely wear your stainless steel necklace in the ocean since salt water will not degrade or tarnish stainless steel like it will silver or gold.
You can also safely take a shower while wearing a stainless steel necklace since the water will not affect the stainless steel in any way.
If your jewelry is gold, silver, platinum, palladium, stainless steel, or titanium, you're safe to shower with it but not all of those are safe to go into the ocean with since the salt water could affect all those except stainless steel.