Depends on what you mean by delete:
- Delete the AD Account on-prem or run
Remove-RemoteMailbox <shared Maibox>
on-prem Exchange Powershell https://learn.microsoft.com/en-us/powershell/module/exchange/remove-remotemailbox?view=exchange-ps - Or move the AD account to an OU that isnt sycned to Azure. the AD Account will remain but just not in Azure
- You can mail disable the remote mailbox on-prem as well which leaves the AD Account intact: https://learn.microsoft.com/en-us/powershell/module/exchange/disable-remotemailbox?view=exchange-ps