To a layman, the 5.56mm. cartridge and the .223 cartridge are the same dimensions. However, many people would advice not to use one in a rifle that is designed for the other, so clearly there must be some differences. This post attempts to clear the mysteries.
First thing to note is that while the US military started switching to metric measurements in the 1950s, in order to better work with NATO military forces, the rest of the US still stayed on with English measurements to the present day. Therefore the US military calls the diameter of the bullet as 5.56 mm. whereas the civilian market calls it .223 caliber (i.e. 0.223 inches diameter), even though they are the same diameter. A good rule of thumb is to assume that when people refer to 5.56x45 mm. cartridge, they are talking about the military-specification cartridge and when they say .223 Remington, they're usually referring to the civilian version of the cartridge.
When it comes to cartridge dimensions, the 5.56x45 mm. NATO cartridge and the .223 Remington have almost identical dimensions. Note that the operative word here is "almost": they are similar enough in shape that either may fit into a gun designed for the other, except for those firearms designed to very tight tolerances. However, there are differences in the pressures and velocities generated by the two types of ammunition. For one thing, 5.56x45 mm. cartridge has thicker case walls. The .223 Remington cartridge also generates far less pressures compared to the 5.56x45 mm. cartridge. What this means is that it is generally safe to shoot .223 ammunition in a rifle designed for 5.56x45 mm. NATO cartridges. The reverse is not true though: firing 5.56x45 mm. ammo through a rifle designed for .223 ammunition may cause excessive stress to the rifle's barrel and chamber because the rifle is designed to operate with the lower pressures of .223 ammunition, which could lead to a very unsafe situation.
While firing .223 Remington cartridges through a rifle designed for 5.56x45 mm. ammunition is generally considered safe, the slight differences in cartridge dimensions make the rifle slightly less accurate than if the .223 Remington cartridges were to be fired by a rifle designed for .223 Remington.