The technology isn’t far behind. The metallurgy is more than behind, it’s generally bassackwards beyond belief.
This is entirely mechanically possible - for an M4 use a complete exising lower (would require modified WesternArms/CA/STTI gas M4 magazines), modified WA upper half, would probably need an underpowered buffer, or a self-contained short reciprocating bolt simiar to the .22lr conversion, with it’s own brass barrel, dummy outer barrel, and hopup.
For a glock upper slide - I don’t think the striker can be used in Glock geometry with any of the standard blowback chamber arrangements out there (when GBB pistols fire, they send about 40% of the expanding gas to propel the BB, the rest into a cylinder that forces the slide to cycle). The magazines also don’t fit.
That said, there are viable training Glocks and M1911’s that already exist, and are pretty affordable.
My Western Arms ICQB fits into every holster, and uses every accessory my LesBaer CQB can. I can run indoor training with the same holster, same magazine pouches, with only minor caveats (mostly, dropping $50 magazines is out). I reworked the trigger, tossed in a spare 15lb mainspring (extreme wear on the shit-quality sear it came with, but I have a somewhat nicely breaking 5.5# trigger), it points the same, runs the same Surefire Lights and GTRL, lives in the same Safariland 6004.
As for the AR’s, they’re coming down in price (the gas versions that more closely replicate the AR15 manual of arms) that will also accept all Magpul and Magpul PTS accessories, so just get a complete airsoft dummy gun that’s simpler. Magazine cost is again the real issue - they’re pricy, as the magazine is the heart of the system, and will require some PM on the rubber seals (and a trip to HomeDepot to get spares at most), but the savings is pretty incredible.
The ability to use them in FOF applications, as well as price per round when using propane or duster gas (A bag of 4000 rounds is $12, a couple cans of propane is $3) when compared to even cheap wolf is eye-opening.
Sadly, very few of them are affordable, and lack the quality to be used the way a blue/red gun would for retention drills, I’ve seen them come apart that way, but for some tailored applications, there’s no legitimate reason not to use a 6mm airsoft gun.
If there’s real interest, I can start putting up pictures and explaining the details of how these work. I meddle in airsoft for recreation, and serious training, glad to put some of this knowledge to work.