The most impressive factor on crystallography and also deviation from Bragg low in XRD studies of crystalline materials is residual stresses. It has been well-known that both of the compressive and tensile stresses can influence the crystallographic structure of materials. Furthermore, one of the most conventional ways to determine the residual stresses in a material is using XRD studies and measuring the deviation of crystalline structure from Bragg low and its stable state (such as peak shifting, broadening and etc).
XRD peak positions of amorphous materials such as water, fat, wood, animal and human tissue as well as a lot of polymere and many others cannot be described by the Bragg law due to the lack of distinct crystallographic reflection planes. Here the Bragg law fails.
Bragg law is the ideal derivation of the diffraction where the xrd peaks has to be a thin line to represent the distance between particular lattice, but in actual it has a shape where the tip is still represent this law. The actual peak is depend on instrument (source, slits, monochromator, etc) and the nature of the sample (crystallite size, strain, APB, etc)
When a wave hits an object that are small compared to a wavelength it is scatterered in a wide range of directions. Crystals are made up of a lot of objects that are small compared to the wavelength of x-rays. If the objects are in a regular pattern, such as an equally spaced line, then the reflections from all the objects in the line will add up in phase not only in the direction of specular (mirror) reflection but in other directions where the extra distance travelled by light from the source to the detector via scattering at one object compared to that scattered from the object next to it increases by one wavelength. Each regular arrangement of atoms results in a measurement of directions where there is a bright reflection, for each incident direction. These are Bragg patterns. This means that the spacing and orientation of regular patterns of atoms (crystals) can be found out by reflecting x-rays from them. x-rays are used because the wavelength is similar to or less than the spacing of the atoms, but bigger than the atoms. If the wavelength is bigger than twice the spacing then there is not any scattering in extra directions, but only in the specular (mirror) direction.