We present ab initio molecular dynamics calculations based on density functional theory to study the hydrogen-deuterium exchange in bulk and nanoclusters of MgH2. Our calculations reveal the important role of catalysts to diffuse the hydrogen at low temperatures and increase the diffusion rate. We determine the diffusion constants, of deuterium, and show the single hydrogen-deuterium exchange in bulk and nanocluster of MgH2. Our calculated value of diffusion constant of deuterium in bulk MgH2 is in excellent agreement with the experimental value. Furthermore, we show the edge site importance of catalysts in the fast diffusion of hydrogen.