I notice this in cats too. There is a stray cat I feed from time to time. When I try to pet her, she does not appreciate it by often trying to scratch me. On the other hand, I stepped on her paw once and she did nothing.
Of course, this is anecdotal evidence.