When I encounter people with dogs I always do a smooch sound to the dog and keep going, automatic at this point. Usually where I am they are driving by or in shopping centers. If outdoors I will say hi to owners also but usually just the dogs are greeted.