Dogs almost always have dewclaws on the front legs and occasionally on the hind legs. There is some debate about whether the dewclaw helps dogs to gain traction when they run because, in some dogs, the dewclaw makes contact when they are running and the nail on the dewclaw often wears down in the same way that the toenails on their other toes do, from friction with running surfaces. However, in many dogs, the dewclaws never make contact with the ground; in this case, the dewclaw's nail never wears away, and it must be trimmed to keep it at a safe length.
There is also some debate as to whether dewclaws should be surgically removed. The argument for removal states that dewclaws are a weak digit, barely attached to the leg, so that they can rip partway off or easily catch on something and break, which can be painful and prone to infection. In some countries, however, removing the dewclaws is illegal, the argument being that the dewclaw will rarely or never suffer injury leading to amputation and that removing it is unnecessarily painful to the dog. In addition, for those dogs whose dewclaws make contact with the ground when they run, it is possible that removing them could be a disadvantage for a dog's speed in running and changing of direction, particularly in performance dog sports such as dog agility. There also exists in folklore a story which claims that dogs that have not had their dewclaws removed are immune to snakebite.
Finally, for the Shar-Pei, the AKC Standard reads, "Hind dewclaws must be removed." and "Removal of front dewclaws is optional"Of course, this is of importance only if you are going to "show" your dog in AKC sanctioned events.
It's hard to teach an old dog new tricks.
Paper and canvas prints of "Growing Up Chinese Shar-Pei" by Barbara Keith are available online.