Character mistake: When the artifacts from the late 19th century, found in a cave, are identified by the away team, Data identifies the pistol as a "double action" Colt 45, circa 1873. The pistol is a Colt single action army, caliber .45. Certainly not a "double action".
Character mistake: When Commander Riker is assembling his away team to visit the planet's surface, he orders Dr. Crusher to bring a medical team. But when the away team is beamed down, Crusher is the only medical officer there.
Answer: Yes. The doors to the holodecks can be locked when in use by anyone aboard the Enterprise so they couldn't be disturbed. However, high ranking officers like Captain Picard could override the doors as it's seen that overrides are in use even for the crews quarters. Even Barclay, when he's indulging in one of his fantasies could have the doors to the holodeck unlocked by an override code.