We investigate the optical and structural properties of GaN and InGaN nanowires (NWs) fabricated by metal-assisted electroless etching in a hydrofluoric acid (HF) solution. The emission spectra of GaN and InGaN NWs exhibit a red shift compared to the as-grown samples resulting from an increase in the surface-to-volume ratio and stress relaxation in these nanostructures. The carrier lifetimes of GaN and InGaN NWs were measured. In addition, density functional theory (DFT) investigations were carried out on GaN and InGaN NWs using the generalized gradient approximation (GGA), including the Hubbard U parameter. The presence of compressive stress in the NWs was confirmed by the DFT calculations, which indicated that it induces a change in the lattice parameter along the c-direction. Formation energy calculations showed that In is a much more stable dopant in the GaN NWs compared to the native point defects, such as Ga and N vacancies. Moreover, electronic structure analysis revealed that the complex defects formed by the presence of In along with vacancy defects shifts the valence band maximum, thus changing the conducting properties of the NWs.