The short answer is usually no! A non-marine grade padlock would rust and seize up very quickly around saltwater. However, top-end manufacturers, like Abus and Abloy, often make their non-marine padlocks to such a high standard that they can be used on boats and salty environments with great effect.
We often have to explain the difference between a padlock for indoor use, outdoor use and marine use. The latter basically means it is capable of functioning in or around saltwater. That doesn’t necessarily mean it is 100% stainless steel but has coatings or some other design that means it can function as normal.
Recently, whilst discussing marine locks with a reader of Practical Boat Owner, they mentioned that they been using an ABUS 65CS/40 in a marine environment for 15 years. For me, 15 years is solid test quite frankly and I was shocked. The 65CS series is a great lock, being low cost and a closed shackle design, but it is not what we would call marine grade by any standard. Anyhow, have a look at the photos below:
As you can see the brass body has discoloured and the shackle has a small amount of rust but they still continue to work after 15 years. Superficial rust on the shackle is of no consequence and if anything, tells a thief it is hardened steel and they might as well try somewhere else. Stainless steel won’t rust but is much softer than hardened steel so sometimes it is best to go with the latter, even in marine environments.
The conclusion here is that some top end brands will still perform in a salty air environment when maintained with a good quality lubricating spray.