Edit: most handguns can’t fire when dropped. I’m wondering if this actually happened as described, or if it was an accidental shooting that was changed.
Badly designed ones. Sig Saur rather infamously has had a ton of problems with guns firing when dropped or in a few instances when bumped while still in a holster.
Most guns should not be capable of going off when dropped or hit, there should be various safety features in place to prevent that.
The P320 is the most recent one that's had this issue. Analysis seems to suggest it's a combination of a bad design and worse manufacturing. In particular the manufacturing quality of the sear has been pointed to as a possible source of issues. Since it looks like a manufacturing defect is a significant contributor many of them may be perfectly fine but it's hard to tell without doing a thorough teardown and inspection by someone trained to know exactly what they're looking for.
When I was around 10 years old my dad had a couple of muzzle loader pistols that he enjoyed shooting. He gave me the safety talk, and showed me how it worked, then he handed me the gun for me to shoot for the first time. It was actually the first time I'd held the gun and it was much heavier that I thought it would be, and I immediately dropped it at our feet. Fortunately it didn't go off, but it left my dad pretty shook up.
These kind of misfires are known to happen (Warning: fictional blood and gore). The right impact can either simulate a trigger pull, directly strike the firing pin itself, or otherwise jostle the firing pin free; especially in older firearms, whether due to design or wear. This is why some places mandate that new firearms sold have a drop safety mechanism.
It would likely have to have been stowed loaded and cocked. If it was in the tackle box, other objects in the box could have disengaged the manual safety (if it was even engaged in the first place) and bumped the trigger.