In this work, first‐principles calculations were used to study the structural, elastic and thermodynamic properties of Mg17Al12 and M‐doped Mg17Al12 (Mg16Al12M, M = Ga, In, Ge, Sn, Pb) compounds. The calculated results show that Mg16Al12M compounds have negative defect formation energies, the calculated phonon dispersions have no imaginary frequencies, and their single‐crystal elastic constants satisfy the mechanical stability criterion. Thus, Mg16Al12M compounds are thermodynamically, dynamically and mechanically stable. The calculated GH/BH, Poisson's ratio v and Cauchy pressure values indicate that Mg17Al12 and Mg16Al12M are ductile, the ductility of the doped system is greater than that of Mg17Al12. Mg17Al12 and Mg16Al12M have elastic anisotropy, and the order of anisotropy is Mg16Al12Sn > Mg16Al12Ga > Mg16Al12In > Mg17Al12 > Mg16Al12Ge > Mg16Al12Pb. Finally, the minimum thermal conductivities based on Clarke's and Cahill's models were discussed, and the results show the heat transfer rates of Mg17Al12 and Mg16Al12M along the [111] direction are faster than those along other directions.