Desert annual plant species are valuable pasture forage and sources for restoration of degraded pastures. Examining the impact of environmental stresses on genetic diversity and population structure can identify species populations suitable for habitat restoration. We examined allozyme diversity and population structure of two annual species, haloxerophyte Salsola incanescens and xero-halophyte S. paulsenii, in association with the type of desert plant community, which reflects the water-salt conditions in the soil. We sampled 19 wild populations in 15 xerophytic, xero-halophytic and halophytic plant communities in Kyzylkum desert (Uzbekistan, Central Asia). The species studied had low genetic variability (P۹۵ = ۰.۰۵–۰.۱۰, HO = ۰.۰۰۸–۰.۰۲۵) and high population structure (FST = 0.585–0.739). Wright’s fixation index indicated deviations from Hardy–Weinberg equilibrium with a deficit of heterozygotes (FIS = 0.79) in S. incanescens populations. No evidence of isolation by distance was found for the species studied (Mantel’s r = 0.02–0.04). Estimates of genetic variability in populations from xerophytic and halophytic plant communities differed significantly (2- to 10-fold, P < 0.05) for both species. Moreover, allele–habitat associations at the GOT and Me loci were found in both species. Decreased levels of within-population variability were found in both species in halophytic communities. In sub-optimal habitats, the decline in genetic differentiation and increase in gene flow were found for both S. incanescens (xerophytic plant communities) and S. paulsenii (halophytic communities). Our results indicate that genetic diversity rather than population differentiation is affected by the habitat type.