Can't. The 7.62x51 cartridge is too long to fit through the M4 lower. The 6.5 Grendel (and other cartridges) can use the same size magazine as the 5.56, so the lower can be re-used.
I do believe, however, that the 7.62x39 can be used through the M4 lower, but I'm not positive.
DPMS sells 7.62x39 ar-15 barrels and magazines.