Yes, simply go to your Organization > Settings > Policies and uncheck the box “Allow users to share files”.
This will stop users accessing share files.
They can of course continue to work, collaborate and sync files in Team Shares, and personal shares they have created on the system.