Depends on the species.
T. crocea are rock-boring clams and must always be on a rock with which to attach their byssal apparatus. This species releases substances from their byssal apparatus that degrades the rock allowing them to bury their shell 1/2-3/4 of the shell's height. This rarely happens in the aquarium though.
T. maxima will also attach to a rocky substrate to keep from being blown around by the current but do not bore into the rocky substrate. They create a small depression in the rock and rarely have more than 1/3 of their shell encased in rock or rock rubble.
T. derasa can be placed on the substrate, but will bysally attach to a rubble substrate. This species will eventually calcify their bysal opening as they grow and have enough bottom weight to their shell that they sit up right on the sandy bottom.
T. squamosa will also bysally attach to rubble, but can be found in nature unattached and resting on the sandy bottom.
The bottom line, they will all attach when small and for good reason. They have evolved to keep from rolling around in the surf's current. However, aside from the T. crocea, IMO they can all be kept on the substrate in the aquarium. I have three maximas that have been living exceptionally well on a crushed coral/sand mix substrate for more than a year. My Teardrop maxima is buried up to its mantle!
It's never a good idea to place a newly acquired unattached clam, high up on the reef for fear of it catapulting itself off with possible damage to itself or other organisms below. Instead, start newly acquired clam on the substrate atop a flat rock or one with a slight depression until it attached, then slowly move it up on the reef. Or place it somewhere on the reef that it is protected by adjacent rocks to keep it from falling.