You can indeed, so long as it is a well managed compost bin that is used to feed non-edible plants. You just need to make sure that your compost heap reaches high enough temperatures to stop the bacteria in your dog's poop.