Acetanilide is not an ester. At any rate, that is not the meaning of 'like dissolves like' exactly. 'Like dissolves like' means that polar molecules dissolve polar molecules, nonpolar => nonpolar, etc. While functional groups themselves will have similar polarity, this polarity does not necessarily translate into defining the polarity of the molecule. For example, C-Cl bond is a highly polarized bond, but CCl4 is completely nonpolar. To determine the polarity of a molecule, you must sum the vectors arrising from each dipole moment of every bond (with time/practice, you can begin to judge polarity by just looking at a molecule, without actually summing vectors).