I can say, in my experience that it is truly contingent on the tool you choose to use.
I am very happy with SDMaid, which i have used for years. It seems to clean everything it says it will.
If you read through my other postings here, you will find I usually recommend it for the "CorpseFinder" functionality to clear remnants of older, non-fully uninstalled apps, though the AppControl, SystemCleaner, and Databases functionality are useful, too.
I am satisfied each time I use it that the cleared item were non-critical, yielding back space I can use. I have not encountered a problem with either my phone, or my tablets, where files were improperly deleted, that I would attribute to some actions of this software.
DISCLAIMER - I am not the developer, or attached to the product in any way, except as a satisfied user.