As kalnaren said, most M4s out there are TM clones. The vast majority of internals and externals are compatible. Where you're find differences are with the recievers. Certain uppers may not mate with lowers from other brands. But the other than that, the vast majority of the guns are 100% compatible in theory. Where this falls apart is that some of the lower end Chinese clones are made to very poor tolerances, so a part that would fit in a TM may not fit as perfectly in a cheap gun. Otherwise, parts are compatible.
The big exception to this is the ICS line of M4s. ICS use a proprietary split mechbox design. While many of the internals are compatible (gears, pistons, springs, etc...), some internals aren't compatible.
And that G&P stock should work fine on a TM.