It is possible to tile over painted drywall, as long as the drywall is sufficiently prepared beforehand. Preparing the drywall requires that the surface be roughed up with a sanding sponge prior to applying the mastic to adhere the tiles in place.
When roughing up the surface of the drywall, a course-grit sanding sponge provides the best results. Just run the sponge over the surface of the paint to break it up, applying just enough pressure to remove the glossy finish of the paint without breaking up the paper surface of the drywall beneath. By roughing up the surface, you give the mastic a better surface to grip, allowing it to sink through the paint and onto the drywall beneath.
Using the sanding sponge on the painted surface can result in dust particles, so it's best to cover adjoining areas with a drop cloth to ease cleanup after when the project is completed. After sanding the surface it's also necessary to dust off the drywall, to remove any remaining particles that may interfere with mastic adherence. Wearing a mask during the sanding and dusting process is recommended to prevent breathing in paint particles, which can be hazardous to your health.