You are literally wrong. There is no code or assets regarding petting anything in vanilla SRB2, as of the current version.
If you want to give anything headpats, you'll just have to make a mod to do so.
Welp, a definitive answer has been given, and I'd rather not have this turn into either a false rumor or "what if" topic, so...