Never had any accuracy issues with my Glock's. Quarter size groups at 25 yards without any problems. The XDm, however, quite simply is a more solid gun, easier to strip due to the XD slide release vs the glock's system. Tighter tolerances in the XDm milling offer a more solid feel and precise action, however makes it more prone to failure if contaminants are present (personally not had this problem as I keep all my weapons clean/lubed). Ammo makes more difference in grouping for me. The match grade internals are nice but with a pistol there isn't much you can do to improve accuracy. The trigger on the XDm certainly feels smoother to me. The bullet is only traveling through 4.5" of barrel in my case. In a semi-auto there are a lot of moving parts. Revolvers used to hold the reigns in accuracy for this reason. Technology has come a long way to even out the playing field.
A Glock due to it's loose tolerances can take sand/water/mud like a champ. Very few guns can perform as reliably while remaining as accurate as a Glock. I can take my glock for example, wash every component with degreaser to remove all lubrication throw it into the dirt, pour dirt over the clip, slide the clip in, rack the slide, and it will fire every time. There is a reason why most police departments, the FBI, DEA, US Marshals, etc chose the Glock as the service weapon of choice. I'm inclined to feel my XDm would not fair as well in environmentally hostile conditions. I don't live in a desert and my back isn't very muddy, so I carry my XDm. Put me in the desert and you would find a Glock in my holster for good reason.
Most military use Sig's almost exclusively 226 (Navy Seals), 228 (Army), 229 (US Air Marshals/Secret Service) (USCG/NCIS/US Postal Service use the 229R DAK 40's). Several units procure their own weapons, and they range anything from an HK, Beretta, Glock, etc... Personal preference, which IMO is the way it should be across the board.
Now when you talk about rifles, that's where you will see serious MOA variances. The barrel actually flexes as the bullet travels, the stainless bull barrels are less flexible and hence improve accuracy. At 300+yards you can certainly see improvements with match grade barrels/trigger groups/etc.. For that side of the house I go to the AR's. When I want some 50yard fun I'll grab my Kalashnikov.