Safety protocols were present to prevent serious injury of the people inside a simulation. This meant that weapons fired within the simulation would not be able to kill or that the computer could prevent dangerous situations when testing a new ship design.
Safety protocols could be overruled if the person in question had the correct access codes. It was also possible for a holoprogram to disable the safety protocols if it was programmed to do so. (VOY: "Worst Case Scenario") A malfunction in the ship's main computer could render the safety protocols inoperative. (TNG: "A Fistful of Datas")
In 2364, when a Jaradan probe inadvertently caused a malfunction in the safety protocols Whalen was shot and seriously wounded by Cyrus Redblock's henchman Felix Leech who also struck Jean-Luc Picard with his Pistol busting his lip for striking him earlier. (TNG: "The Big Goodbye")
In 2372, Julian Bashir and Elim Garak ran the holoprogram Julian Bashir, Secret Agent together. While fighting Falcon and his men, Bashir noticed that Garak was bleeding. Garak noted that the holosuite's safety protocols must have been turned off. (DS9: "Our Man Bashir")
While trying to evade the Borg on the USS Enterprise-E, Captain Jean-Luc Picard and Lily Sloane retreated into one of the ship's holodecks, where Picard ran a holoprogram of the Dixon Hill series. He was able to kill both of the Borg who were following him with a machine gun after turning off the holodeck safety protocols. (Star Trek: First Contact)
In 2373, General Martok told Julian Bashir he had deactivated the safety protocols of a holosuite on Deep Space 9, leading to an injury, although he had in fact been injured by Worf. (DS9: "Soldiers of the Empire")
In 2375, after learning of the Maquis' destruction in the Alpha Quadrant, B'Elanna Torres began running dangerous holodeck programs on the USS Voyager with the safety protocols turned off. (VOY: "Extreme Risk")