Yes pulling your hair out can be a sign of anxiety and even stress.
It can be as simple as sometimes a person is stressed and they pull their hair out during stressful situations and other times it could be because of anxiety or even just boredom.
There's also a rare condition that causes people to pull out their hair.
The condition for pulling out hair is called medically trichotillomania which is a rare anxiety disorder that leads to people pulling out their hair.
Sometimes people who have trichotillomania disorder will also have other disorders, such as depression, anxiety or obsessive-compulsive disorder.
Therapy can help sometimes but there's no cure for it.