Context. The forthcoming arrival of the NASA's Dawn spacecraft to Ceres and Vesta means that these unexplored worlds in the asteroid main belt are targets of several studies. Aims. We study the impactor flux and cratering on Ceres and Vesta caused by the collisional and dynamical evolution of the asteroid main belt. Methods. We develop a statistical code based on a well-tested model for the simultaneous evolution of the main belt and NEA size distributions. This code includes catastrophic collisions and noncollisional removal processes such as the Yarkovsky effect and the orbital resonances. It is worth noting that the model assumes that the dynamical depletion of the early main belt was very strong, and owing to that, most main belt comminution occurred when its dynamical structure was similar to the present one. Results. Our results indicate that the number of D > 1 km main belt asteroids striking Ceres and Vesta over the solar system history are approximately 4600 and 1100, respectively. Moreover, the largest main belt asteroids expected to have impacted Ceres and Vesta had a diameter of 71.7 km for Ceres and 21.1 km for Vesta. As for the cratering, our simulations show that the surfaces of Ceres and Vesta present a wide variety of craters with different sizes. In fact, the number of D > 0.1 km craters on Ceres is ∼3.4 × 10 8 and 6.2 × 10 7 on Vesta. Moreover, the number of craters with D > 100 km are 47 on Ceres and 8 on Vesta. On the other hand, our study indicates that the D = 460 km crater observed on Vesta had to be formed by the impact of a D ∼ 66.2 km projectile, which has a probability of occur of ∼30% over the solar system history. Conclusions. If significant discrepancies between our results about the cratering on Ceres and Vesta and data obtained from the Dawn Mission were found, they should be linked to a higher degree of collisional evolution during the early main belt and/or the existence of the late heavy bombardment. An increase in the collisional activity in the early phase may be provided for an initial configuration of the giant planets consistent with, for example, the Nice model. From this, the Dawn Mission would be able to give us clues about the initial configuration of the early solar system and its subsequent dynamical evolution.