Atomistic study of chemical effect on local structure in Mg-based metallic glasses