OSX Mail - deleting imap email without deleting on gmail server
You can check Mailbox Behaviors in your Gmail account setting (under Accounts) and check Store deleted messages on the server. This will make your messages still available in other clients even if you delete them in the Mac where you have this setting.

Reference: Mail (El Capitan): Mailbox Behaviors preferences