The effect of dopants on the metallic glass forming ability is usually considered based on analysis of changes in the liquid structure or thermodynamics. What is missing in such considerations is an analysis of how a dopant changes the properties of the crystal phases which can form instead of the glass. In order to illuminate this aspect we performed molecular dynamics simulations to study the effects of Mg and Sm dopants on the crystal nucleation in Al. The simulation data were found to be consistent with the experimental observations that addition of Mg to Al does not lead to vitrification but addition of only 8% Sm does. The significant effect of Sm doping was related to the intolerance of Al to this dopant. This leads to increase in the solid-liquid interfacial free energy, and therefore, to increase in the nucleation barrier and to dramatic decrease in the nucleation rate. The intolerance mechanism also significantly affects the growth kinetics.