It's not a good idea because your city would then be full of poisoned food and dead decomposing dog corpses.
If you do live where the city or country doesn't have centres that humanely kill strays and/or the government doesn't have a protocol for dealing with them, get some thick boots, a strong stick and hope you don't run into one of the 10+-strong packs that roam certain neighbourhoods.
In case there's a stray dog that's aggressive towards people and lives near your home and you definitely positively must put it down, a common humane poison is antifreeze - it first induces drowsiness, then stops the heart. A pretty literal "put to sleep".