can CMS caching mechanism (For example Joomla cache), Gzip compression and Cloudflare work all together in perfect harmony?
Yes, plus they all do slightly different things.
Cloudflare caches the static content, eg images and stylesheets. Fresh page HTML is still downloaded by every visitor on every page.
Gzip compression comes into play both with Cloudflare and your server. By default Cloudflare automatically compresses content passing through it's system, Files not passing through Cloudflare can be compressed by your server, Caching and gzip compression by htaccess , though since you are using Joomla, the easiest way to enable this is from
the control panel > system > global configuration > server > Gzip Page Compression.
This will decrease download times for the page HTML and the dynamic content produced by Joomla.
Using Joomla cache will typically reduce page load times because instead of Joomla using modules and plugins to recalculate the dynamic page content everytime for every visitor, it will simply use the saved cache content. You can cache Joomla content by page, by module or by plugin, here's one good explanation of the differences.
It's worth spending some time testing with a tool like WebPageTest to find the best Joomla cache option for your specific site. I've sometimes had significant savings with this.
It's makes sense to have all 3 working on your site, it will reduce server load and speed up page display.
Good luck!