The account that I had deleted was IMAP and deleting it removed all emails from the server. On the other hand, that account was accessed solely from my iMac and not from a second computer, iPhone, or iPad. Still, I would not take the chance of deleting it without backing up everything (and, frankly, I don't know how to do that). Still, you could copy ~/Library/Mail as a possible way to back up, but I can't guarantee that that will work.