Magnesia (MgO) particles inevitably exist in liquid Mg and may be used as potential sites for heterogeneous nucleation to achieve effective grain refinement. Understanding of the atomic configurations on MgO surfaces and in the liquid Mg adjacent to the liquid Mg/MgO interfaces is therefore of both scientific and practical interests. We investigate the surface structures of MgO in liquid Mg and the atomic arrangements of liquid Mg adjacent to liquid/substrate interfaces, using an ab initio molecular dynamics (MD) simulation technique. We find that an atomically rough terminating Mg layer forms on the {1 1 1} terminated MgO substrate (octahedral MgO) in liquid Mg. The simulations also reveal that on the structurally flat {0 0 1} terminated MgO substrate (cubic MgO) a rough Mg layer forms due to the unique chemical interactions between the ions on the substrate and the liquid metals. The surface roughness together with the large lattice misfits with solid Mg makes both octahedral and cubic MgO substrates impotent for heterogeneous nucleation of a-Mg. The present results may shed new light on grain refinement of Mg-alloys.