How to do pairwise comparisons for Kruskal Wallis test? If the null hypothesis in the Kruskal Wallis test is rejected, How can we perform pairwise comparisons? Can we apply Dunnett's Test for that?

You want to use a post-hoc test that is designed for the Kruskal-Wallis test.  A common one is the Dunn (1964) test.  This is a rank-based test, that is somewhat like performing pairwise Wilcoxon-Mann-Whitney tests, but uses the ranks from the whole Kruskal-Wallis test, not just the individual pairs.
