A two-axis scanning microelectromechanical (MEMS) mirror enables an optical coherence tomography (OCT) system to perform threedimensional endoscopic imaging due to its fast scan speed and small size. However, the radial scan from the MEMS mirror causes various distortions in OCT images, namely spherical, fan-shaped and keystone distortions. In this paper, a new method is proposed to correct all of three distortions presented in OCT systems based on two-axis MEMS scanning mirrors. The spherical distortion is corrected first by directly manipulating the original spectral interferograms in the phase domain, followed by Fourier transform and three-dimensional geometrical transformation for correcting the other two types of distortions. OCT imaging experiments on a paper with square ink printed arrays and a glass tube filled with milk have been used to validate the proposed method. Distortions in OCT images of flat or curved surfaces can all be effectively removed.