Actually most all clams are found on a hard substrate.
Hippos are the exception they are usually found with their shell about a 1/3 into the sand.
That being said, some clams are found up high on the reef and others down low. This bottom of the reef is what most people think is a sand bed, when normally in nature, it is not. It is still rock.
Croceas top of the reef bored into rock or coral, often porities.
Maximas, lower in the reef, still on rock.
Deresas. Bottom of reef, often on hard substrate, but sometimes found in sand.
Gigas, bottom of reef, usually hard substrate
Squamosa bottom reef hard substrate.
If you are interested in keeping clams, and providing them the proper home, you should check out Knops Clam book.