It’s a good rule of thumb to always ask before you pet someone’s dog. You never know if they’re an asshole (the person or the dog) OR maybe they are just trying to protect you.
This goes for all dogs, not just service dogs. That’s what @ravenscimaven on Twitter is getting at in this thread. I think it’s worth hearing her, and the other dog owner in this thread.