Black Jack Pershing cut a stripe down his leg when his 1911 went off in the holster when he threw a hissy fit during a briefing and stomped the floor very hard.
The 1911 was only intended for cocked and locked carry when secured in the issue flap holster, and even then only cocked and locked immediately before going into battle.
Normal carry was either with empty chamber or hammer down on a round in the chamber.
The p-38 pistol was designed for the Wermacht. It originally had an enclosed hammer, but this was changed more due to psychological reasons than anything else. Shooters were reassured by being able to see the position of the hammer.
Second strike capability was a benefit when much of the 9mm cartridge manufacture at that time was intended for use in blowback SMGs and hard primers were in common use.
I know how important that could be since I had some WW2 era SMG 9mm ammo and found my P-35 often required three strikes to set it off. That ammo was super hot stuff, closer to .357 energy levels. it had a truncated cone cupro nickel jacket bullet, near as I can tell it was Italian and meant for the Berretta machine carbines.
Even with standard pistol ammo lack of proper cold weather lubes meant congealed oil could slow down a hammer fall enough that it might take more than one strike to ignite a cartridge in sub zero conditions.
A Savage pocket auto I repaired years ago had a very dangerous condition brought on by loosening of the slide rails.
If you pressed the trigger while the safety was engaged it would not fire, but if you later released the safety it would fire without having pulled the trigger.
Tightening the slide rails cured that situation.
The Polish Radom 1935 was known to AD when applying the safety, if the firing pin was a tad too long.
Worn or ill fitting parts can result in hidden dangers.
Some Lugers rebuilt by Spandau could be fired simply by squeezing the external sear cover plate. The Japanese had an autoloader that had the same problem from the factory.
The Browning 1910 had a rep for doubling if worn and not kept well oiled.
I learned of that in reading a book writen by a forensic expert. He had solved a locked room mystery involving a man found with two bullet wounds to the head.
They had even arrested the butler, believing he had killed his boss.
On testing they found the pistol doubled almost every time it was fired, so it had been a suicide afterall.
That was one true case that sounded more like a Sherlock Holmes story.
A pistol in excellent mechanical condition, and properly cleaned and lubed should not go off by itself, but there are numerous possible factors that can cause an AD.
Not pointing the gun at anyone doesn't always prevent harm being done. Ricochets off stone or tile floors have caused deaths, such as the bank job where Patty Hearst was almost charged with felony murder.