There could be a number of reasons why your dog is rubbing his face on the carpet. He may have a mucky face that he just wants to clean, or he may simply just like the feeling of rubbing his face on the carpet so will go for a good head rub every so often.
A lovely young spaniel resting its head on the carpet
If your carpet smells particularly interesting your pup will want to rub his face all over it to smell it. He could be using your carpet as an itching device in response to allergies, or he could have parasites such as those pesky fleas or ear mites. If you suspect this might be the reason then you will need to treat your dog for fleas. If your dog is constantly rubbing his face on your carpet you should contact your vet. It may be a more serious skin condition.