By default, SharePoint Online tenancies have scripting capabilities turned off, closing off a myriad of useful features such as being able to upload certain file types (.aspx, .master), being able to create custom page layouts, and even using the Content Editor and Script Editor web parts.
For more information, see: https://support.office.com/en-us/article/Turn-scripting-capabilities-on-or-off-1f2c515f-5d7e-448a-9fd7-835da935584f
We can enable scripting from the Office 365 SharePoint Admin Centre, as detailed in the link above. However, the changes are not instant and take up to 24 hours before being applied.
Or we can instead enable scripting on a specific site collection for it to take effect immediately, using the SharePoint Online Management Shell:
Connect-SPOService <SP Admin Centre URL> Set-SPOSite <Site URL> -DenyAddAndCustomizePages 0