Replacing multiple substrings in a string
Variable naming

N0OfIterationOverTemplate is not only a mouthful, but anyone will also start to wonder about that weird spelling choice of combining a zero 0 with a capital O together. countIterationOverTemplate is much easier to follow.

null handling

Erm, consider how you want to handle potential null values safely.

Biggest difference

Test case: "template", "a", "b", "a", "c"

In the first method, it immediately replaces the "a"s with "b"s, so the second substitution to "c" is effectively a no-op. You end up with "templbte".

In the second method, there's only one substitution being performed, due to how Map.put(K, V) works. Not only that, it's indeterministic which substitution will happen due to how HashMap.keySet() has no predictable iteration order.

Interfaces over implementations declaration

This is the least of your concern here given the biggest difference above, but you are highly recommended to declare map as a Map instead of HashMap because where it's used, it does not need to be known about its actual Map implementation.