they will be fine if you just set them on the rock, however things like inverts and sometimes fish can come by and knock them off. So in the long run it is best to secure them with glue or a stock or something like that.
I have a few glued down, but for the most part i just trie to wedge the base between a crack in the rock.
It all depends on the coral, and if it is on a plug or not. It's kind of a case by case basis.