If you put red pepper around your fence would that keep dog from digging?

Putting red pepper around your fence is unlikely to be an effective deterrent for dogs from digging. Dogs have a strong sense of smell, but that doesn't necessarily mean they are repulsed by certain odors. They can be attracted to smells like peppercorn, onions, and chili powder - things we find pungent. There are few options you could try instead such as chicken wire fencing.