By default SharePoint Online doesn’t allow to access it’s pages via iframe from an external application in this article we can see how to override that restriction
How to solve cross domain issue ( CORS ) in Asp.Net web application using IIS URL rewrite module
In this article let us see How to solve Cross-origin resource sharing (CORS) issue using IIS Re-write module for any .Net Web Application that uses client call to perform advanced requests (POST PUT DELETE and other types of HTTP requests along with specifying custom HTTP headers)