Yes Magnets will work underwater. You can even get special magnets, called retrieving magnets, to pick up objects containing iron that have fallen into lakes or wells. This can be a lifesaver if your keys fall into a tank of sharks or alligators.
For more detail go through the link i mentioned below