I've had unanticipated dealings with law enforcement at my home twice. The first time, a couple of uniforms (with a marked squad car out front) rang my door late in the evening - when I answered, they politely asked if I owned a car parked across the street. (I didn't.) They asked if I knew who did. (Again, no.) They asked if I knew how long it had been there, or if I saw anyone with it. (About a week, and no.) They thanked me for my time and went on their way. Car was towed the next day.
The second time, I happened to be looking out the window and saw a squad car out front, with a uniformed officer walking down my driveway and then going around the side of my house.
So I went out, walked up behind him, and asked "Can I help you?"
I guess I scared him a bit, though it wasn't my intention,
but he took it good-naturedly and told he he'd had a complaint about a barking dog at my address, but could see it was actually the neighbor in back of my house with the barking dog. (Yards adjoin directly with no alley.)
He apologized for disturbing me, we chatted for a couple of minutes, and he went on his way . . . a few minutes later he was at the other home talking to Fido's owner.
In both instances, with a visible squad car and uniformed officers, I was pretty confident they were legit. If a NON-uniformed LEO comes by unexpectedly, I'm calling 911 to verify his bona fides - especially since there HAVE been instances here in TX of impersonaters causing trouble.