There are raccoon traps that are dog proof as well as other animals, even some that will hang on a tree trunk. Box traps catch too many unwanted critters, although they do not injure them 😌
We have Coyote hunters here that use traps and poison that catch and kill more dogs and cats than Coyotes.
I have a live trap for Raccoons that come too close to the house. My Mountain Curs had one treed in the back yard once. I finally couldn’t take the baying anymore and put out the live trap. Got it in minutes. We took it to a very remote area and turned it loose. It was a juvenile, about half grown.
I prefer a good rifle with a scope for Coyotes.