No, it’s not—not without the dog owner’s permission. People who try to pet an unfamiliar dog through the fence or on the neighbor's property leave themselves open to a dog attack. This is because the dog will think they’re trespassing or trying to break into the property.