I don't think it's appropriate to dicipline another persons pets randomly.
However, if someone comes into my home with a dog who starts jumping and barking, I will tell the dog to sit, then treat it, and usually it stops jumping and barking at that point. A firm 'no' followed by a treat when it is behaving appropriately is OK, in my home. Not to a random dog on the street.
Usually pet owners don't mind 'light dicipline' (a firm 'no' and 'good dog!' followed by a scratch) for general behaviour such as jumping, chewing on your hand (puppies, anyone?), begging, etc.
People will get upset if you start spraying their pets with water or giving treats, if you don't know what treats they approve of.
At least, in my part of the world, and in my experience.