I don't know about this specifically but my experience with compulsive habits (and I have a few) is they need to be stopped in their infancy, or they become so ingrained that they become almost impossible to stop (she says as she violently chews on the inside of her mouth).
And since you really don't want her pulling our her hair, you should do whatever it takes to stop this habit before it becomes fully ingrained. I once knew a girl who had trichotillomania, and her bald spot wasn't attractive, and the hair that grew there was so ruined that even if she managed to stop it would never grow properly again.
If it were me, and I couldn't stop it, I would cut her hair so short that she couldn't do it, and let it grow again when she had stopped. She's only 2, so it doesn't matter if her hair is really short.
Maybe that's overreacting, but good hair is important on females, so you definitely want to end this habit now.