G36 rails won't fit on an m4, sorry. Would look a bit silly, too.
As for the handguard rails: By all means. I had one on my M16 for a while, I'm not a fan of overloading a gun with rail systems, makes it look stupid. Just enough room for a vertical grip and flashlight.