Probably. It's called Allelopathy. It's the response where each coral produces chemicals to irritate or even kill it's neighbors to protect itself and its territory, but you already knew that, right.
Using a scissors or razor blade, swiftly cut the Mushroom off the rock as best you can before it retracts. You can let the cut Mushroom float around until it finds a new place to attach or you can put it in a cup of rubble to attach so it can be placed in a spot of your choosing.
Mushrooms are closely related to Anemones.
Aloha,
Mark