Dogs are way different than people.
A dog who got sprayed will likely steer clear next time. A person you sprayed might come back with three friends and guns.
I am not trying to be alarmist. However, I know I lived in one city that had places I simply didn't go after a less-than-pleasant experience. It worked out well that one time, but I chose not to roll the dice with my safety.
I don't know anything about your situation. However, I Think (I surely don't know) if it was me, and I felt that I wasn't safe riding somewhere without a weapon, i simply wouldn't ride there.
On another hand, if you carry pepper spray and it helps you feel safe enough to ride there, so long as you never need it ... you have won a great victory. Do whatever you need to do.