We report experimental characterization of optical and dielectric constants of ZnO and ZnMgO nanowires (NWs) with Mg mole fraction of 9%, 18%, 29% and volume fraction 43.5% in terahertz (THz) region using terahertz time domain spectroscopy (THz-TDS). Measured index of refraction and absorption coefficient for ZnO nanowires are 1.12 and 10.7cm−1 at 1.5THz which increases by 32% and 132% for ZnMgO nanowires with Mg mole fraction of 29%. Real and imaginary dielectric constants for ZnO NWs are 1.122 and 0.01 at 1.5THz which increases by 32% and 58% for Zn0.71Mg0.29O nanowires. Time resolved terahertz spectroscopy (TRTS) of ZnO nanowires provides real and imaginary conductivity of 0.1 and 0.008 (S/cm), respectively which increased by 294% and 58% for Zn0.71Mg0.29O nanowires. The measured parameters are extrapolated to obtain characteristics of MgO nanowires in the terahertz regime. Observed theoretical values of dielectric constant of MgO nanowires (2.25) are smaller than those of bulk MgO (6.6) which is attributed to an air–nanowire composite in the nanowire samples. Bruggeman effective medium theory was implemented to extract permittivity of bulk MgO from composite which is in excellent agreement with reported data. With the increase of nanowire density or volume fraction, optical properties of nanowires more resemble those of bulk.