We don't have the capacity to replace the canine nose, which can sense chemicals at parts per billion. We will probably never be able to make anything which can do that, and cover the ground the way a dog can, because whatever we engineer will inevitably be very heavy. It is also likely to be even more costly than a carefully-bred and fully-trained dog. Dogs can also work in a vast range of weather conditions, from well sub-zero to over 40C (depending on breed type and acclimatisation).
Likewise, I'm not sure how you would plan to replace stock dogs of various kinds. Again, depending on type and acclimatisation they can work anywhere from the Mongolian winter (well into the minus numbers) to the Australian outback (over 40C). A dog is relatively cheap, a bit tricky to train but fairly easy to maintain, and knows much of its job instinctively (the issue is usually controlling the dog). It's not too hard to breed dogs for specialised tasks, like keeping the wolves off the flock (as livestock guardian dogs do from Iberia across Asia), or bringing in sheep from a distance (like New Zealand huntaways). Friends of mine have a huntaway who works their cattle; he's worth several people on quad bikes. His entire lifetime cost (purchase, puppyhood, training, food, vet and insurance, retirement, housing) will probably be about the cost of just buying one new quad bike, never mind 3 or 4, and maintaining them and employing the people on them.
So there is that.
Police and security dogs can sometimes de-escalate situations that would otherwise end up with people being shot/stabbed/otherwise damaged (I've listened to several podcasts featuring a bloke who used to work in the security industry; he explains all this very clearly).
And no, I can't replace my dogs with another pet. I work one of my dogs; there is no other domesticated species that can do what she does.
And see above for my comments on the connection between pet and sport dogs, and working dogs.
I don't expect to convince you, but perhaps I can show you just a little bit about what you don't know about dogs.