FWIW, IMHO, the first variable to consider is your planned use of the gun. For a first gun and learning fundamentals, I recommend a medium-large to large frame revolver in .38 special/.357 mag, shooting standard .38 special. I am particularly fond of the S&W 686 or 686+ but the Ruger GP 100 is also excellent. This size of gun will keep felt recoil low and encourage good shooting habits. An additional benefit is that they will allow you to train both single- and double-action. I you like DA, that will allow an easy transition to DA and SA/DA semi-autos. If not, then staying with a striker-fired semi-auto or 1911 is a more likely down the road choice. Finally, .38 special is inexpensive and still easily found.
If you want to start with a semi-auto, I would lean toward a full-size pistol, like the Glock G17, Springfield XD Service, Sig 320, and S&W M&P, all of which are reasonably priced. New shooters almost always do better learning on a full-size pistol because of less felt recoil, easier grip, longer sight radius, and overall controllability. The 9mm is probably the best initial choice both for lower recoil and cost, and availability of ammo and pistols is improving. As I learned and trained extensively on 1911s well back in the last century, I find the grip angle of the Glock line a problem, but this will not be an issue for a new shooter whose muscle memory and conditioned reflex are not wedded to the1911 grip angle.
Your choice of a pure self-defense pistol will be largely determined by concealability and season. I carry a sub-compact or micro-compact in summer clothing and a compact or full-size gun for fall and winter wear. Since I'm 6'1", 240#, concealment is not a real issue with me but smaller guys may have issues with larger guns. For personal defense guns, the only modificationsI favor are sights and grips...a modified gun is usually questioned by prosecutors (and you will be carefully investigated by them if you ever have cause to use gun). I have never used a handgun for self defense since getting my first in 1973 and live in such a way as to minimize the likelihood of ever doing so. The only fights that you win are the ones you avoid.
As to brands, S&W and Ruger for revolvers and Springfield, Glock, S&W, H&K, Sig Sauer, and Beretta are all fine and reliable as are most 1911s. For 1911s, I am partial to older Colts and Springfields for mid-priced guns and to Ed Brown and Wilson Combat for custom and semi-custom.
Good luck,
Harry