And no truer statement has ever been made. Yes, you can usually shoot a gun that doesn't fit properly, but you will never reach the height of your ability with such a gun.
A handgun should be centered in the web that reaches from the thumb to the index finger. When held properly, there should be a straight line from the front sight, through your hand, and all the way to the crook of your arm. At the same time, the first pad of the trigger finger should be flat on the trigger if it is a single-action pistol. And the first joint of the trigger finger should be centered on the trigger if it is a double-action pistol.
In order to obtain this proper grip, don't be afraid to experiment with replacement stocks. They will often be all that is necessary to assure a good fit. For example, I can get by with just about any 1911, but to do my best work I use the thin stock panels that are often advertised as Concealment Stocks. On the other hand, I am just out of luck when it comes to most of the pistols that feature higher-capacity magazines because the grip frame is just too thick for me. Can I shoot them? Yes. Do I shoot them well? No.
Even some of the polymer-frame pistols, which actually have no stocks at all, are now being offered with replacement backstraps so the gun can better fit an individual's hands. In fact, there are all sorts of aftermarket stocks available for most defensive pistols and revolvers. If your hands are small, go for thin stocks. If your hands are large, check out the thick replacement stocks.
The important thing is to not be too quick to give up on the handgun of your choice. Most experienced shooters have a box of pistol stocks they have tried, discarded, and replaced. In fact, after you've been shooting for a while, you may make additional stock adjustments and changes. That's just fine because it is all a part of making the defensive handgun fit you. They're like shoes, remember?