Dog scratching is commonly found in dogs, where the owners are lax in maintaining the hygiene and cleanliness of the dog. Fleas, mites can be found stuck to dogs skin amidst the hair and it causes continuous irritation to the dog that can only express it by itching and scratching the floor or whatever comes to their sight.
In some cases however it may be triggered by new food that may have been introduced to the dog, and in cases where the dog's scratching has suddenly started this could be the reason. One must think through to see of there is a new food that has been introduced to the dog that may have caused this reaction. A few practices like regularly cleaning the dog as per the schedule, using a good quality hypoallergenic soap, combing the hair, feeding a well-balanced healthy diet are good ways to stop dog scratching. If all cleanliness measures are taken then there is no need to worry much and one must see if the dog is licking too while scratching; which may indicate simply that the dog is bored and needs exercise. Dogs love outdoors and if they don't get to go out and run and be physically active then it may cause boredom.