I'm not sure how you would prevent it really. From what I've read it can happen when a guinea pig is initially introduced and may settle down, or it can be down to things like a lack of hay so they will eat their cage mates hair ( this is all what I've read though ).
I don't have a great deal experience of it myself to be honest, some of mine do it, though it's mainly whiskers they go for, and I've even watched them doing it and the majority of the time the "victim" just sits there and lets them so it can't bother them too much.
I think wiebke has a piggie that does this, though whether she knows of a way to stop it I don't know!