The obvious solution is to fence off our garden, and make sure there's a gate which is always kept closed so the dog can't access your garden!
We had this once about thirty years ago, on a new estate where we weren't allowed to fence off our front gardens, and an elderly neighbour was in the habit of letting his dog out to poo whereever it wanted......one Sunday morning I saw the dog poo right in the middle of our front lawn so I marched srtaight down to the neighbour, holding the dog by its collar, and insisted he comeout in his dressing gown to oick up his dogs' mess! Which he did, and it never happened again - but had it happened, my husband and I wouldn't have hesitated to report the dog to the local dog warden as a stray not on a lead.