It’s a self soothing mechanism for babies.
It’s normal. Not all babies do this but it’s a way of soothing. Our daughter did it for a long time. It took a while for her to stop and transition so pulling/scratching a comfort toy. She still scritches her head and runs her hands through her hair when she’s tired now and she’s almost two!
Is he doing it hard? Or is it like a comfort pulling? Like you would a label or with a comforter?