  This paper is devoted to discuss compact stars in
$f(\mathscr{R},\mathscr{G})$ gravity, where $\mathscr{R}$ and $\mathscr{G}$
denote the Ricci scalar and Gauss-Bonnet invariant respectively. To meet this
aim, we consider spherically symmetric space-time with anisotropic fluid
distribution. In particular, the Karmarkar condition is used to explore the
compact star solutions. Further, we choose two specific model of compact stars
namely LMC X-4 (mass =1.29$M/M_{\odot}$ \& radii=9.711 km) and EXO 1785-248
(mass =1.30$M/M_{\odot}$ \& radii=8.849 km). We develop the field equations for
$f(\mathscr{R},\mathscr{G})$ gravity by employing the Karmarkar condition with
a specific model already reported in literature by Lake [Phys. Rev. D 67,
104015 (2003)]. We further consider the Schwarzschild geometry for matching
conditions at the boundary. It is important to mention here that we calculate
the values of all the involved parameter by imposing the matching condition. We
have provided a detailed graphical analysis to discuss the physical
acceptability of parameters, i.e., energy density, pressure, anisotropy, and
gradients. We have also examined the stability of compacts stars by exploring
the energy conditions, equation of state, generalized
Tolman-Oppenheimer-Volkoff equation, causality condition, and adiabatic index.
For present analysis, we predict some numerical values in tabular form for
central gravitational metric functions, central density and central pressures
components. We have also calculated the ratio $p_{rc}/ \rho_{c}$ to check the
validity of Zeldovich's condition. Conclusively, it is found that our obtained
solutions are physically viable with well-behaved nature in
$f(\mathscr{R},\mathscr{G})$ modified gravity for the compact star models under
discussion.
