Logically the following upgrades are really easy to switch:
Scopes, red dots, underslung grenade launchers, melee attachments, suspensors, exterminator cartridges
The following will require some common sense:
Silencers only exchangable with similar weapons (a stub revolver won't be compatible with an autogun for example due to calibres),
And some just can't be exchanged:
Extra grip/pistol grip (is a modification of the weapons existing grips), compact (cutting down an existing weapon), vemon-drip (built into a melee weapon), lathe-wrought (a manufacturing technique).
Ultimately it comes down to common sense and not trying to powergame. If you want red-dots on all your guns, it doesn't mean you just swap the attachment in the middle of combat - you have to buy them for all your guns.