Anyone really have a trusted mechanic to inspect used cars?

So the usual advice when purchasing a used car is to have it checked out by a “trusted” mechanic. I have a hard time thinking this is a real thing, unless you happen to live near a cousin who also happens to be a mechanic, or work in an automotive-adjacent field, where you might get to know mechanics.

Has anyone here actually taken a car they don’t own to a mechanic to have it checked out? I guess that pretty much precludes buying a car out of town, since how many dealers are going to let you drive a car 100 miles to your mechanic, and then 100 miles back, and you decide not to buy it. Also, do you get much side-eye from the salesmen if you ask to plug in an OBD2 code reader?