To specify whether users can get apps from the SharePoint Store, you can follow the steps below.
Sign in to Office 365 with your SharePoint Online admin account.
Go to the SharePoint admin center.
Select Apps on the left, and then select App Catalog.
Select Create a new app catalog site, and then select OK.
On the Create App Catalog Site Collection page, enter the required
information, and then select OK.
Back to Apps, and then select Configure Store Settings.
Next to App Purchases, select No if you do not want users to be able to get third-party apps.
For more information, you can refer to the following article:
Configure settings for the SharePoint Store
After this whenever someone tries to add an app will receive this message:
"Sorry, apps are turned off. If you know who runs the server, tell them to enable apps."
lis.style.visibility = 'hidden';