I suspect they would not be too interested in my compost. For one thing, there is a lot of manure in it, and the addition of alfalfa (which I acquired as pellets and mixed with manure in a big garbage can) helps keep the pile cooking and interesting only to the decomposers.
Also, balancing the carbons and nitrogens, keeping the pile covered with a layer of straw or the like -- I have found white pine shavings, purchased in a bale and usually used for animal bedding, to be a great carbonaceous layer.
Finally, most of the food material I put in there is raw fruit and veggie scraps. No cooked food, no oils or fats, and definitely no animal products with the exception of eggshells.
The one composter I heard of who had fox visit his pile was composting meat scraps along with everything else. But he was willing to manage that as it needs to be and didn't mind mama Fox and her kits visiting from time to time.
Racoons are also primarily carnivorous, I believe, so though they might be curious at first, I doubt they'd mess with it much.
Here, there *used* to be a rat living in a hole under the shed, when the compost was just garbage dumped in a pit. My cousin is a vegetarian, and doesn't cook a lot, so her garbage wasn't all that appealing to many varmints, but there was also a pile of dried branches right next to this pit operation.
Right after I set up my compost out there, she told me she saw the rat come out from under the shed and scoot off into the neighbor's yard. That yard is almost a woods, very dense with plant cover. She also said she had always tried to pretend it was just a mouse. But this time she got a good look at it.
Anyway, nowhere I've ever composted have I had varmint trouble. Except this one time:
But that wasn't trouble, only interest.