Yes, you can place it on the live rock. In fact, my candy canes started growing a lot more when I moved them higher in my tank.
You can use gel super glue, underwater epoxy, and just wedge the base the coral in a hole in the live rock. I have used the last two options for two candy canes that I have.
Here is one of my candy cane frags in January that I mounted on the top of the live rock:
And here is a recent picture (the one on the left was in the sand, and I moved up there in late January also):