If you notice your dog repeatedly pressing their heads against the wall, floor or other object for no apparent reason, your pet could have a dangerous medical condition.
Doberman with hepatic encephalopathy evincing head pressing
The behavior is called "head pressing", and it is characterized by the compulsive act of pressing the head against something solid for extended periods of time.