SAAMI released one set of specifications for the.223 cartridge and the military went with another set of specs. The military specs are slightly more powerful than the commercial specs.
The SAAMI specs (.223) allow a slightly lower pressure than the military (5.56) specs allow. But the big problem is that military 5.56 has a slightly longer neck than .223. So, if you try to fire 5.56 in a .223 chamber it’s possible that the longer neck will get wedged into the barrel and hold onto the bullet when the rifle is fired. Naturally it will break free when pressures rise high enough, but it might require high enough pressures to damage the rifle.
So of you have a .223 chamber do not fire military grade 5.56 in it. However a 5.56 chamber can shoot .223 just fine. So for general use the 5.56 chamber is considered superior. However for target/hunting use the .223 is probably better as the chamber is specifically designed for the .223 commercial cartridges you will be using.
Incidentally you have a similar situation with 7.62 and .308… Only in reverse. The SAAMI .308 specs allow for higher pressures than the military 7.62 standards allow. So don’t fire commercial 308 in a rifle chambered for 7.62.