Many dogs get into the habit of scratching at carpets. It’s frustrating, expensive, and often seems to start out of nowhere.