It's true though, that this is often the reason for stressed dogs biting. Too often the problem is that the owners themselves don't recognise the signs and gets bitten (or their children do) by their own dog.
Let's put known problem breeds aside for a moment, because part of the issue with them is that it seems there are frequently none of the usual warning signs and that those dogs don't especially need a classic 'trigger' to attack. Their unpredictability and tendency to become aggressive very quickly for no obvious reason is well documented. But let's consider other dogs which make good family pets are don't have a bad rep.
Of course, it's the owner's responsibility to make sure that their dog doesn't bite other people. And it's the owners responsibility to teach their dog good recall and not to jump up at people, and if they can't, then it shouldn't be allowed off leash in areas where there are people about. Absolutely no argument there.
But it also wouldn't hurt non-dog owners to educate themselves and very importantly, their children, about how to behave around dogs and what not to do, to stress or antagonise the dog. Most dogs are fairly submissive and biddable around humans, but they have their limits like all of us. Even a non-aggressive dog may nip or growl or bite if sufficiently stressed or antagonised. In most cases all the warning signs are there. Ultimately it's the responsibility of the owner to minimise the risks of that happening while out in public or if inviting people into their homes, but I do feel it's a sort of collective responsibility for us to all learn a bit of basic dog psychology. If you don't want to that's fine, but then the onus is on you to stay well clear of every dog and don't assume you can approach or pet a dog or allow your children to do so, as you feel like it. If you or your kids want approach a dog in a public place, or at a friend's house, you need to make sure you all understand what not to do, and the kids need supervising as well as the dog.
We once had a party and a few of our friends brought their primary school aged children. Despite having been raised in a household with children and lots of visiting children and never being a problem, my children were all older by then and my dogs were a bit long in the tooth and out of practice with the chaos of younger children being around. They were not enjoying this intrusion to say the least, so after a while I put them in their crates in a sitting room.
But while all the adults were in the garden the children we running all over the house, shrieking and being a bit wild. I went into the house and caught a couple of the kids with their faces pressed against the front of the dog crates, shouting and screeching at the dogs, who were looking visibly stressed and shaking.
Luckily, I am a responsible owner and a very risk averse person in general. I had crated my dogs and I regularly checked on them and the children. I told the children in no uncertain terms not to enter that room again, that they were scaring the dogs and how would they feel if they were locked in a cage and someone was screeching in their faces and they couldn't escape? Had I not crated them, had I been drunk or otherwise distracted it could have ended very badly. I don't believe my dogs would ever have seriously mauled or savaged a a child, but do I think they'd bite, or react aggressively given sufficient provocation? Absolutely. Who wouldn't? And would it have been my dogs' fault? No. Not unless you are prepared to accept that any form of self defence as a reaction to quite justified fear is always wrong, and the the 'fault' of the person or creature committing it.
It would have been my fault if a child had been bitten, for not anticipating an issue, not recognising signs of stress in the dogs and not supervising the situation well enough. That said, while I don't expect children not to screech and get over-excited when playing, I'd hope their parents might have taught them not to tease animals and annoy animals on purpose, and to be mindful of their behaviour in general. To have some empathy and some respect. They weren't toddlers, they were nine and 10 years old.
We understand that it's not a great idea to climb into the bear or lion enclosure in a zoo, but when it comes to domestic animals we have a tendency to see them as giant cuddly toys with endless patience who can be clambered on and pulled around and treated without respect, instead of creatures who, however well socialised and domesticated, will react when exposed to enough irritation or stress just as we might.
We can't realistically expect that the definition of a 'good' dog is one who has been trained to accept any amount of goading, abuse and annoyance, with people repeatedly invading their space and getting up in their grills and never react to it. That's what cuddly toys are for, not live pets.
But that's how some people seem to think a dog should be expected to behave, and if it can't then it has no place existing.