What is stamped on the side of the rifle? If it is stamped .223, then you should not be using 5.56 (for the most part...See below.) If it's stamped 5.56, it won't care either way.
Why? There are a number of differences between the calibers. The most serious of which is that the 5.56 x45 NATO runs at a higher pressure than the .223 Remington for the most part.
5.56 mm NATO versus .223 Remington
The 5.56 mm NATO and .223 Remington cartridges and chamberings are similar but not identical. Military 5.56×45mm cases are often made thicker and therefore have less case capacity. However, the NATO specification allows a higher chamber pressure. NATO EPVAT test barrels made for 5.56 mm NATO measure chamber pressure at the case mouth, as opposed to the location used by the United States civil standards organization SAAMI. The piezoelectric sensors or transducers NATO and SAAMI use to conduct the actual pressure measurements also differ. This difference in measurement method accounts for upwards of 20,000 psi (140 MPa) difference in pressure measurements. This means the NATO EPVAT maximum service pressure of 430 MPa (62,000 psi) for 5.56 mm NATO, is reduced by SAAMI to 55,000 psi (380 MPa) for .223 Remington. In contrast to SAAMI, the other main civil standards organization C.I.P. defines the maximum service and proof test pressures of the .223 Remington cartridge equal to the 5.56 mm NATO.
The 5.56 mm NATO chambering, known as a NATO or mil-spec chamber, has a longer leade, which is the distance between the mouth of the cartridge and the point at which the rifling engages the bullet. The .223 Remington chambering, known as SAAMI chamber, is allowed to have a shorter leade, and is only required to be proof tested to the lower SAAMI chamber pressure. To address these issues, various proprietary chambers exist, such as the Wylde chamber (Rock River Arms) or the ArmaLite chamber, which are designed to handle both 5.56 mm NATO and .223 Remington equally well. The dimensions and leade of the .223 Remington minimum C.I.P. chamber also differ from the 5.56 mm NATO chamber specification.
Using commercial .223 Remington cartridges in a 5.56 mm NATO chambered rifle should work reliably, but generally will not be as accurate as when fired from a .223 Remington chambered gun due to the longer leade. Using 5.56 mm NATO mil-spec cartridges (such as the M855) in a .223 Remington chambered rifle can lead to excessive wear and stress on the rifle and even be unsafe, and SAAMI recommends against the practice. Some commercial rifles marked as ".223 Remington" are in fact suited for 5.56 mm NATO, such as many commercial AR-15 variants and the Ruger Mini-14 (marked ".223 cal"), but the manufacturer should always be consulted to verify that this is acceptable before attempting it, and signs of excessive pressure (such as flattening or gas staining of the primers) should be looked for in the initial testing with 5.56 mm NATO ammunition.
It should also be noted that the upper receiver (to which the barrel with its chamber are attached) and the lower receiver are entirely separate parts in AR-15 style rifles. If the lower receiver has either .223 or 5.56 stamped on it, it does not guarantee the upper assembly is rated for the same caliber, because the upper and the lower receiver in the same rifle can, and frequently do, come from different manufacturers – particularly with rifles sold to civilians or second-hand rifles.
In more practical terms, as of 2010 most AR-15 parts suppliers engineer their complete upper assemblies (not to be confused with stripped uppers where the barrel is not included) to support both calibers in order to protect their customers from injuries and to protect their businesses from resultant litigation.