Can a bullet hit make the cockpit door open?
The FAA standards seem to anticipate the use of firearms by people attempting to gain unlawful access to the cockpit.

Opening locks with firearms is probably not as successful as TV would have you believe.



Cockpit Door Standards


  Press Release – FAA Sets New Standards for Cockpit Doors
  Release No. APA 01-02
  January 11, 2002
  Contact: Alison Duquette  Phone: 202-267-3462 WASHINGTON, DC
  In response to President Bush's call to strengthen aircraft security, the
  U.S. Department of Transportation's Federal Aviation Administration
  (FAA) today published new standards to protect cockpits from intrusion
  and small arms fire or fragmentation devices, such as grenades. The
  Aviation and Transportation Security Act authorizes the FAA to issue
  today's final rule that requires operators of more than 6,000
  airplanes to install reinforced doors by April 9, 2003.


From FAA Press Release

This press release doesn't actually say that the locks on the doors must resist being fired on using handguns but it is apparent that the scenarios envisaged included those where handguns were present. There are obviously other measures to prevent passengers carrying combat shotguns into the cabin surreptitiously.



Guns and Locks


  In movies and television, a locked door, or a padlock on a cage is never an impediment so long as the Hero has bullets to spare. One or two shots is generally enough to destroy the lock, allowing the door to open.
  Unfortunately, in real life — as shown by the MythBusters — this requires a high powered gun at close range, which causes lots of very dangerous shrapnel. Lesser firearms, especially handguns may harmlessly bury rounds in even standard padlocks to little effect. Only SWAT teams and soldiers ever do this in real life, and it involves a shotgun, Kevlar body armor, specialized ammunition (a powdered metal breaching round, often jokingly referred to as "Avon Calling"), and full face protection. Even then, the goal is not specifically to destroy the lock, but to destroy the surrounding door or the hinges. 


From TvTropes Shoot out the lock



Other references


Mythbusters - shooting locks