Terrier breeds are natural hunting dogs, and will instinctively dig in the ground for prey or food.
There's no point trying to deny their instincts.
Your dog may be digging a hole to stash away food or items of shelter.
Female dogs may dig holes as part of their natural mating behavior.