From the various gun guys I follow, it sounds like most of them would run a short-barreled carbine of some sort (m4a1, mk18, hk416 or some sort of AR15 derivative usually) in various tier 1 and tier 2 units (most of the guys I follow were tier 2 though, so US Army Rangers and the like). A short-barreled carbine is a versatile weapon, capable of room-clearing and also taking mid-range engagements, so while something like an mp5 would be better in CQB, it's all well and good until you leave the building and some asshole with an AK starts shooting you at 400m. Obviously you have units like the SAS running the mp5 for the Iranian embassy siege, because that sort of operation you can be confident will be entirely CQB, but for general carry I would say a short barreled carbine is the most realistic. Also, in general, rifle calibres have more ability to penetrate body armour and helmets than pistol calibres. In terms of sidearm, I think it varies and comes down to personal preference. Heard lots of stories of US units swapping out their m9s for 1911s, so in terms of sidearm it's down to personal preference. That said, I think a lot of them like various Glock models, but if you don't like that you can always go with something like a mk23, as that was specifically designed for USSOCOM, or some sort of Sig, as I believe Glocks, Sigs, Berettas, HKs and even 1911s still get used in SF units.
However, there's also an element of what your role is. For example, if you're a sniper, you're likely using something like an m110 SASS or m24 SWS, which is definitely not a short-barreled carbine. If operating in a recce role, you may be using a long-barreled carbine instead like a mk12 mod 1 SPR, as you need to be able to engage out to longer distances than a short-barreled carbine is capable of. Also, you could be a support gunner in which case you're probably carrying an m240b or mk46. I think weapon choice is a wide net, since different units use different weapons and different roles also use different weapons, so there's a lot to choose from.
In terms of setup, I do believe that SF operators are allowed to set up their guns however they want, though obviously I can't confirm that as I've never been one or asked one that specific question. M-LOK is currently all the rage, so if I was going to set up some sort of SF operator loadout I would probably do a short-barreled AR-15 or hk416 with an M-LOK handguard and stock of your choice, alongside a QD suppressor, something like a Surefire. Then I'd probably mount a PEQ box for laser (both visible and IR) as well as an IR illuminator, then I'd probably also mount a weapon light, since I believe the PEQ only does IR illumination and you do still want a weapon light, and some sort of front grip. In terms of sight, I'd say an Eotech for a red dot sight on a short-barreled carbine.
In terms of barrel length, I think most SF units prefer 11" over 14.5" barrels, since it's more useful for room clearing and CQB and doesn't have too many negatives at long range (though obviously a 14.5" will do better at longer ranges). Somewhat depends on the theatre of war though, as if you're fighting a war in the mountains with no CQB at all then you're not going to want to bring an 11" carbine, however I think that's a rarity.
Obviously this is all just my speculation on what I've read around and what I hear in the real-steel shooting world. Could be entirely off the mark, could be 100% accurate, I have no idea on its validity ?