Sometimes.
Most of the more popular ar15 accessories have an equivalent airsoft component and a lot of real deal gun accessories will fit.
Like rail mounted or mlock/key mod.
Some of the airsoft guns are close enough that handguards and grips will bolt right up.
Stocks can be iffy because most of the time the batteries go in the stock.
Watch out, tho your "cheap" trainer airsoft can quickly become as, if not more, expensive than your real one.
IMO I would worry less about duplicating your go to rifle and just get an approximation to practice fundamentals with. (Sight picture, presentation, trigger control, reloads, etc)
Those skills are pretty universal across the board.