It seems no matter where you go, whenever you get a few "gun guys" together, the question always comes up,"If you could only have one gun, what would it be and why?" It's inevitable, like running out of ammo. I guess the Internet is no different.
My pat answer to this age-old question has always been the good old 12 Ga. shotgun. In any configuration it is a formidable weapon, but I prefer pump action or double barrels. Auto loaders are too finicky in my opinion and single shots are, well, single shot. I LOVE single shot firearms for sporting, but for the "one gun" scenario, it's not preferable.
Why the 12Ga.?
I'll start by saying that the shotgun is debugged technology. It was literally the first type of firearm produced, it was designed in China in the 12th century. Grapeshot out of a cannon or a Howitzer is nothing more than a very large shotgun, and is still used today. It has been the trusty companion to pioneers, farmers and police officers. It's the most common firearm in America and likely the world, with the possible exception of the .22LR.
The most compelling reason to choose the shotgun is it's versatility. It is a single firearm you can hunt ANYTHING with, just by changing the type of shell you use. Birdshot, buckshot, slugs and even specialty rounds such as incendiary, tear gas, flashbang and flare are easy to find and not too spendy. Throw in many less than lethal options such as beanbag and rubber shot and it's easy to see, nothing can match it's wide range of applications.
In addition to changing shells there is the option to swap barrels. This is true for all shotguns, for the most part, and usually only takes seconds to do without needing any tools. In 30 seconds or so, you can change from a 28" barrel used for upland bird or waterfowl to a scoped slug gun capable of precise shots out to 250yrds and beyond. When you get home, another 30 second swap and you have a 18" open cylinder tactical shotgun with flashlight, laser and all the bells and whistles.
The 12Ga. shotgun particularly shines in this role, for many reasons, not all of them having anything to do with it's sheer stopping power, which is quite significant. It's intimidation factor is second to none. The sound of a shell being chambered in a pump shotgun is universally understood. It transcends language, imparting a clear message that you mean business. Adding a series of actions such as strong commands to leave, lighting him up with a BRIGHT flashlight, and putting a dime sized red dot on his chest, will disorient, confuse and scare any "troll" around. This means you may not actually have to discharge your firearm, and this should be your goal.
There is also a decreased chance of over-penetration with a shotgun, and this is important, especially in urban and well populated areas. Remember, you are legally and morally responsible for every round you fire, and you don't want a horrible accident adding to an already bad situation.
In a survival role, in addition to versatility, ammunition would be widely available. Every sporting goods store, hardware outlet and any place else that sells ammo will have a stock of various 12 gauge shells. With a few simple reloading tools, you can "cannibalize" any gauge of shotshell for it's powder, shot and primer and load it in a 12Ga. shell. You don't even need shot. Just use ball bearings or nuts and washers or even coins, like all the old western stories.
In conclusion, there are many other candidates to fill this role, the AR-15 platform, SKS/AK-47, many bolt action centerfires, various handguns and even the Ruger 10/22 (my second choice) can be argued as the best all around firearm. Not one of them can fill the shoes of the world's oldest firearm design, and through centuries of refinement, the shotgun has evolved into a perfect tool.
I would hate to think of a world where I could only have one firearm, but if I had to choose, it's the good old 12 bore scatter-gun for me.