Earthworms are safe for most tropical fish. Make sure they eat all you put in, or it can upset the balance.
If these were added to an existing tank, keep in mind that many of the crabs sold for aquariums are brackish, all need access to the surface, and many are a threat to the fish in with them.