Coffee grounds certainly possess an odor that can deter dogs. You can sprinkle them around specific areas to create a natural barrier. However, keep in mind that coffee grounds contain caffeine, which is toxic to dogs when consumed in large amounts. Ensure your dog does not have access to the treated area and monitor their activities closely.