A comparative study on generalized model of anisotropic compact star satisfying the Karmarkar condition