This is caused by a mite that tunnels into the skin and causes an allergic reaction. This causes intense itching. The dog spends most of its time mutilating itself. There is no respite to the itch until the mite is killed and the allergic reaction to the mite settles down.
Usually, the dog is chewing its legs and scratching its abdomen and ears. Small scabs are usually present on the skin. This mange is extremely contagious and will have been contacted from an infected dog or fox. Dead foxes on the road can be a source of infection also.
Hair loss is a feature and an intense itch is associated with this mange. All dogs can get this at any age. Vets diagnose this with a skin scraping to look for the mite.
Treating scabies can be achieved by buying a spot-on product called Revolution (selamectin) and applying it fortnightly to the skin on the back of your dog's neck. The itch itself will still need to be addressed.
There is also another type of mange called Demodex but it is unusual for this to cause a severe itch. Bald patches in a young dog without an itch is a feature of this Demodex type of mange. Demodex occasionally causes an itch when a more intense allergic reaction develops. This is called "red mange". It seems that dogs that have Demodex mange have an immune system that isn't able to keep these mites under control. Demodex mange is also seen in older animals with immunosuppression from cancer or hyperadrenocorticism.