My son did this and I found out that is hac be hereditary. Come to find out, my neice used to do it as well but she pulled her eye brows out.
Our ped. told us to keep his hands busy. You did the right thing by getting her a doll. Sorry her fingers got tangled up. Try a stuffed animal that is very furry, like a lion with a mane or something similar. Or try a baby blanket with a satin edge or one of those taggie toys http://www.taggies.com/home_us.html
They have the satin tags all over them that kids love to play with. Try not to draw attention to what she is doing when she is pulling her hair, simply hand her something to keep her hands busy without drawing attention to the fact that she is pulling out her hair.
I hope she can stop. My son hasn't done it is a while.