Is anal masterbation unhealthy? Is it safe?

There are some risks. Anal receptive sex can cause tearing of anal tissues including perforation of the colon. Repeated anal sex can weaken the anal sphincter muscle & cause problems with incontinence. It can also lead to transmission of sexually transmitted diseases and other infections. .
Maybe/maybe not. The anal sphincter(muscle) is a delicate muscle. It can signal when you are ready to poop,but can stop it if it would be inconvenient. It can decide if you have gas, liquid or poop trying to exit & let the gas out if no friends are around. Anal skin is loaded with sensors, so masturbation can stimulate the brain, but if you are aggressive and injure the muscle, you can loose some capabilities.