IME Maxima clams do well in either or situation. I personally keep an extremely shallow sand bed for aesthetic purposes only (approx 1/2") in which case I do not require using a piece of rock under the sand for the clam to attach to. Rather, the clam just adheres to the glass bottom of the aquarium.
When placed on the rock work, I tend to put the clam in a shallow divot (it is extremely important not to jam the clam into a tight space where it can not open comfortably/fully) so that the clam is slightly cradled to allow it to attach without being knocked over or bumped off the rock work.
Keep in mind a clam may not always attach where you want it to - but the fact of the matter is, it will always attach where it is most comfortable. The clam generally knows better then you about where it wants to be. I do not recommend constantly relocating a clam unless it is putting itself in immediate and/or inevitable danger.