While the two cartridges are very similar they differ enough to pose a very dangerous combination in a mismatched chamber.
SAAMI recommends not using 5.56mm mil-spec in a .223 chamber due to the significant pressure differences. The 5.56 chamber has a longer free or leade area, this, in addition to a slightly longer headspace, helps deal with the higher chamber pressures developed by the 5.56.
The differences in pressure between the .223 Remington vs. 5.56mm can be between 10,000 to 20,000 psi. This can make chambering a 5.56mm cartridge in a .223 chamber potentially very dangerous.
The only down side to the reverse scenario, a .223 cartridge in a 5.56 chamber, is the possibility of a slight loss of accuracy due to the longer leade area.
If you should have any questions regarding safety, contact the firearm manufacture.
There is a chamber, for instance, known as the Wylde chamber used by Rock River Arms that is suited for either cartridge.