In some cases, thinset can stick successfully to painted drywall. But this really depends on the quality and condition of both items. If there are any lumps or bumps on either surface, these need to be sanded down as they will interfere with successful adhesion between them. Aside from that, all glossy surfaces must be removed as they will prevent proper bonding between the wall and the thinset matrix. If you feel confident that all conditions have been met, you can apply thinset mortar onto your painted drywall. For example, pre-mixed thin-set mortar, tile & stone thin-set mortar, ceramic tile thin-set mortar, and premixed premium grout are some good quality products that can be used for this purpose.