We demonstrate that chemical reactions leading to the formation of AlO radicals in plasmas produced by ablation of aluminum or Ti-sapphire with ultraviolet nanosecond laser pulses can be predicted by the model of local thermodynamic equilibrium. Therefore, emission spectra recorded with an echelle spectrometer and a gated detector were compared to the spectral radiance computed for uniform and nonuniform equilibrium plasmas. The calculations are based on analytical solutions of the radiation transfer equation. The simulations show that the plasmas produced in argon background gas are almost uniform, whereas temperature and density gradients are evidenced in air. Furthermore, chemical reactions exclusively occur in the cold plume periphery for ablation in air. The formation of AlO is negligible in argon as the plasma temperature is too large in the time interval of interest up to several microseconds. Finally, the validity of local thermodynamic equilibrium is shown to depend on time, space, and on the elemental composition. The presented conclusions are of interest for material analysis via laser-induced breakdown spectroscopy and for laser materials processing.