Ionic liquid surfactant (ILS) shows potential application in surfactant enhancing oil recovery (SEOR). The structure–activity relationship between structural characteristics and foam feature is significant for the design and selection of favorable ILS for foam enhanced oil recovery (FEOR). In this paper, the effect of structural substituent groups of anionic ILSs on foam features was established through experimental methods and Density functional theory (DFT) simulations. Physicochemical features of hydroxyl-based anionic ILS, 1-(2,3-dihydroxypropyl)-3-butylimidazolium dodecyl sulfate ([DPbim][DS]) was detected. By surface tensiometry, the critical micelle concentration (CMC) value of [DPbim][DS] was 0.427 mmol/L. Foam properties of three ILSs ([DPbim][DS], [Hmim][DS] (1-hexyl-3-methylimidazolium dodecyl sulfate), and [Bmim][DS] (1-butyl-3- methylimidazolium dodecyl sulfate), and sodium dodecyl sulfate (SDS) were established. The foam features of ILSs and SDS followed: [DPbim][DS] > [Hmim][DS] > [Bmim][DS] > SDS. ILS hydrates showed tendency: [Bmim][DS](H2O)n > [Hmim][DS](H2O)n > [DPbim][DS](H2O)n. D0 values followed the tendency: [DPbim][DS](H2O)n > [Hmim][DS](H2O)n > [Bmim][DS](H2O)n. Experimental and DFT results verified the introduction of hydroxyl group and longer alkyl chain length in imidazolium cation was favorable for foam features of ILSs. This information will help to screen new foam surfactants for FEOR.