It is almost never okay to kill somebody's pet.
Bob is having problems with the neighbor's dog coming into his yard and trampling his garden.
Bob wants to stop the dog's behavior.
Bob goes and talks to his neighbor about controlling the dog better.
Bob puts some poisoned meat in his garden for the next time the dog comes over.
Bob doesn't have any more problems with the dog after his neighbor agrees to put up a fence.
Bob is later arrested and charged with animal cruelty when the dog dies from eating the poison.