Lanthanide-doped MgB4O7 is a potential dosimetric material due to its thermoluminescence (TL) and optically stimulated luminescence (OSL) properties. These properties have been largely reported, but there are few theoretical studies dedicated to understanding the materials defects. The aim of this work is to demonstrate that defects are a key issue to understand the luminescence mechanisms. A new set of interatomic potential parameters were obtained reproducing the MgB4O7 structure better than 2% and 4% for oxide precursors. The results showed that the O Frenkel defect is the most probable which can account for the intrinsic blue emission in the undoped material. Also, the extrinsic defect calculations demonstrated two possible doping schemes for lanthanide ions. One lanthanide dopant group prefers the direct substitution at the boron site with a molecular ion of (BO3)-3 moving to balance the strain caused by this substitution. Another prefers a substitution at the magnesium site with an MgB anti-site as the charge compensation defect.