What is it that you are describing as 'petting'? Did the fish just happen to be idling where the coral was at or was he really getting involved? Wouldn't worry either way unless you see him doing this behavior elsewhere...like scratching.
but Im sure corals do not like being "hosted"
To the contrary, corals are hosted all the time by numberous types of fish and inverts. They benefit from the tidbits of food from those that do host them and in turn, the corals add protection for the fish and inverts. This symbiotic relationship far extends from the boundries of the well known clownfish and anemones. Even clownfish have hosted corals instead of anemones. I even saw a clownfish host a fake plant...it was funny to watch her try to shove food into what she thought was a mouth...LOL. On the flip side, other fish besides clownfish have been seen hosting anemones. I've personally have never seen a foxface take to coral in such a way, but it was also quite bizarre when divers saw hawkfish and gobies hosting anemones. The behaviors of clownfish are now thought to be studied by other fish in the reef and then apply the technique themselves.
We, as a people, know so much more about outer space than we do about our own oceans. This lack of knowledge can very well spell the dangers that lay in wait for us.
The oceans surely would swallow us before a rock comes down to smite the planet of it's life.