I think most crabs will leave coral alone if they are well fed. The thing is, though... if say a small colony of zoanthids are not doing well in your tank, they may decide to eat it before you have treated it with a lugol's dip.
In regards to hermit crabs, they all need plenty of empty shells laying around otherwise they will kill and rob your snails'
shells. This is true for the electric blues as well.
If you do want crabs, a way of making sure they are well fed is by dropping a piece of thawed brocolli on the sandbed. My hermits went after it, and I was able to feed Most of my other corals without a problem.
But I still had to stand there & monitor every dinner.
Especially stuff that was "climbable" such as my caulastrea.
If the hermit was closer to the caulastrea with food, than the brocolli on the sand... they'll take the shortest path to a full meal.