Yes, it would legal, albeit highly unconventional and unprofessional. The law does not make the contents of a resignation letter confidential in the absence of some specific agreement to keep them confidential; and, as a more general matter, once you send a letter to another person, they are free to transmit, pubish, post, etc. it, again, so long as there is no agreement to not do so.