No, it isn't illegal. Even though soccer kicks, crotch hits, and hair pulling are illegal moves in UFC, slaps are still legal.