I think it's a spectrum more than absolutes in this case. If there's an immediate threat to your kid's life, do what you gotta do. You'd do the same if your senile mother got it in her head to try and stab your kid to death and you didn't have any other options, right? If there's no immediate threat, then you'd explore other options first if you're not a sociopath. What were the circumstances? Can the pet and/or child be trained not to do dumb things? If no, is there anyone who could take the dog in? Any local no kill shelters, etc?