There are a few parts that are not identical in measurements. I've heard the foreguards are not exactly standard, and I can say first-hand that my second generation M4gery will not accept a replacement safety - very different machined shape). If the firearm accepts a third-party trigger group, then the standard safety would probably work with that group.
I may be wrong, but by second generation, I mean the first M4 clones with brushed-on paint. (whereas the 1st gen was the full-sized rifle with horrible handguards, and the third gen M4 has the white lettering).