Bear/pepper spray contains capsaicin, it works on anything with mucous membranes.
The difference is only size and range of the delivery system, as far as I’m aware… so bear spray, comes in a massive can that only lasts like 4 sprays, but human pepper spray is a small can that lasts 25 sprays… but you probably don’t want a bear, or a wolf, to get close enough to use it, hence large can with at least a 10 ft spray zone and a ton of chemical.
(Edit: I’m a hiker, I keep a can on my belt. But the best deterrent is to make a lot of noise so the bears can piss off before you get there. They don’t really want to be around humans anyway)