You need to use a developer site in O365, or enable side-loading of apps like described in this link:
App sideloading, from a SharePoint context, is the ability to install a SharePoint app directly into a site to explicitly bypass the regular governance controls of SharePoint.
Warning: Sideloading apps is a developer/test feature not intended for production use.
Do not sideload apps regularly, or keep app sideloading enabled for longer than you are actively using the feature!
The developer site is the intended place for app development to take place in SharePoint—it is designed specifically for app developers to install and test apps before they are released to the store. There are certain site collection templates, such as Search and Project, which are not compatible with the dev site template. This means that developers cannot test apps designed for use with those templates with the developer site alone. The sideloading feature enables development against site collections that use a different template without affecting the UI. By enabling sideloading, an admin opens the door for anyone with app install permissions to install apps that are not sourced from the app catalog or app store.
In addition to the above, the ability to sideload apps is also useful when one has either an Enterprise or Professional subscription. In this case, the developer site is not the default site. In this case, we recommend creating a new site collection using the developer site as the base template to test apps in, but app sideloading could also be used to load and/or test apps instead.
Specific for your error:
Visual Studio calls the
Microsoft.SharePoint.Client.AppCatalog.IsAppSideloadingEnabled method for the given site collection URL, which returns true if the site is a developer site or if the site has the sideloading feature enabled. For a Site Collection to work which is not a developer site, the sideloading feature must be enabled.
Enabling app sideloading requires tenant admin permissions (in a multi-tenant environment) or farm admin permissions (in a single tenant environment). When you begin development in Visual Studio against any of the site URLs above without these permissions, the error "Sideloading of apps is not enabled on this site" will appear and the app installation will fail.