The dominant factors affecting nucleation of deformation-induced martensitic transformation in grains and at grain boundaries of pure iron were investigated by molecular dynamics simulation. Furthermore, the effectiveness of microstructure design based on the obtained dominant factors was verified. The nucleation mechanisms of martensitic transformation within grains were classified into four types, and it was found that lattice defects developed within grains (such as stacking faults, deformation twins, and their intersection regions) can reduce the local nucleation stress required for martensitic transformation. Conversely, the local nucleation stress required for grain-boundary nucleation is smaller than that required for in-grain nucleation, indicating that the grain boundary is an effective nucleation site for martensitic transformation. The dominant factor affecting in-grain nucleation was the magnitude of the loading-direction component of the transformation strain induced by lattice deformation. In contrast, the two dominant factors affecting grain-boundary nucleation were the grain-boundary misorientation angle and grain-boundary free volume. The former allows the interface between the bcc structure generated at the grain boundary and the two fcc structures comprising the grain boundary to maintain the Kurdjumov-Sachs (K-S) relationship, or double K-S relationship, while the latter promotes the atomic structure change of martensitic transformation at the grain boundary site. The possibility of controlling the timing of nucleation by designing the microstructure based on the obtained nucleation factors is tested by comparing two polycrystalline models with different microstructural designs.