It is not possible to allow the compare functionality to works for some specific products/categories and not for all the product/categories.
You can switch off the “Enable compare” from Theme Settings >> Shop>> Compare. But it will disable for all the products and categories not for some of them.
Screenshot: https://jmp.sh/1OQ6pou