Not illegal per se, but if you're under a preservation order and specifically instruct someone to use disappearing messages to evade it, it can get a bit iffy.