How to find out programmatically whether any cache plugin is installed in the WordPress website?

Cache plugins don’t necessarily all work the same way. You’ll need to find the popular ones and figure out how each one works to see how you can identify if it’s active manually.

If you’re tying to change some behaviour in your theme or plugin based on whether the site is cached, my advice would be: don’t try and be clever about it, just give the user the option to control the behaviour themselves.