For me, I get acne on my hairline from holding my hair dryer too close to my skin and brushing too hard or too much. Also, seems like hair spray and other hair styling stuff breaks me out on forehead and near my hairline.
Usually for me it's just that I need a haircut or that I slept on the side of my face. I try to stay on my back and can if I think about doing so before I fall asleep, but I'm naturally a side sleeper so I get a bit of a pimple or two on the temples from time to time.