Depends on what you have. Some anemones and clams have to be in the sand, some have to be on rock. Anemones will also move about until they're happy. Sun corals need low light and low to slow-moderate flow and can be placed wherever suits those requirements the best. Zoas, palys and star polyps can be on rock or plugs in the sand, in the rockwork or glued to your glass, even. A lot of LPS like acans, brains, favias, chalice, etc...do best in sand, while Euphyllia can be put about anywhere with slow flow and high light. SPS tend to do best high in the rockwork where they can get tons of light and high flow, but if there's a spot that can provide both of those and a solid mounting spot in the sand, then they can be placed there. Usually SPS and fleshy LPS (Euphyllia, Platygyra, Plerogyra, etc...) are best mounted on rocks to give them a solid place to spread out. Most polyps (Zoas, Palys, etc...) also do best on rocks because they have a solid surface (as opposed to sand) to grow new matting on, bit they can usually be persuaded to grow on glass and use up that tank space, also.