It happens occasionally, but it's pretty rare. I heard a story some time back of a gunman who drove up on a birthday party or something, and a bystander shot them.
The rate is far lower than the rate of gun accidents, or even gun homicides though. It's not an argument for lax gun laws. It just is an occasional side effect that can't and shouldn't be counted on.