With on-prem, you would really need to use OOS to make this happen effectively:
https://bhargavs.com/index.php/2015/11/18/configuring-rich-attachment-preview-in-exchange-2016/
https://learn.microsoft.com/en-us/Exchange/plan-and-deploy/install-office-online-server?redirectedfrom=MSDN&view=exchserver-2019
With this architecture. you can allow viewing as a rich document and prevent downloading of office docs etc...