My poor cat has mixed feelings as I pet her while she's cleaning her self.
I had a cat that did not like to be petted. You could scratch her head until your fingers went dead but if you pet her she'll bite. For everybody but me it was just a warning nip. She'd bite the shit out of me though. Then she'd clean the spot I touched and give me a dirty look.
I read somewhere that cats sometimes groom themselves when stressed or anxious. It's a coping mechanism.