I have never heard of carpet beetles hiding in hair. If you find some beetle in your hair, it could be any variety of dermistid beetles. Not all are harmful, and it could have ended up there by accident. I doubt that this is anything to worry about. If you wash and dry your hair daily, then that is enough to kill most insects.