I was trying to prove that $S_3\times Z_2$ is isomorphic to $D_6$.
Well there are a lot of methods to do so.
But I was queried that
If we know if two abelian groups have same number of elements of each order then they are isomorphic?
Also, do there exist a abelain and a nonabelian group satisfying the property but still not isomorphic?
So my doubt is -- is it true If both are nonabelian and have same number of elements of each order then they are isomorphism?
No; there are many more groups than there are possible sets of orders. In this MO answer you can find a counting argument that makes this precise and in this MO answer you can find an explicit minimal counterexample of order $16$ (although I haven't checked to see if you can find a counterexample where both groups are nonabelian).