I just did this to a neighbor last week. To be fair, it was an urgent issue. I was driving down the street on my way to work and their dog was out of their gated yard with the gate wide open. I would have put him in the yard and shut the gate, but he backed away from me and growled. I knocked and rang their doorbell several times to alert them. No one ever answered, but I have seen them walking their dog in the meantime.