Yes, you can use a metal detector with some restrictions depending on where you go.
Ocean City:
There are no restrictions on using a metal detector in Ocean City.
Assateague Island State Park:
In the state park on Assateague, metal detectors are only allowed beginning the day after Labor Day through May 30th and only on the ocean side of the primary dune. During the season you will need to get written permission to use your metal detector from the Park Manager.