With the continuous improvement of the requirements of spiral bevel gear transmission for low noise and high precision, the optimization of high-efficiency tooth surface accuracy considering the motion axis error of machining machine tool has become a key point in the process of designing and manufacturing spiral bevel gear. Based on the theory of the multi-body dynamics system and the principle of gear meshing, a new tooth surface error model of spiral bevel gear considering the error of machine-tool moving axis is proposed and optimized, so as to obtain higher tooth surface accuracy and meshing efficiency. Firstly, according to the motion and machining principle of spiral bevel gear NC grinding machine, the corresponding relationship between the motion error of each axis of the NC gear grinding machine and the variation of cutting parameters of spiral bevel gear is analyzed, and the geometric motion error model of spiral bevel gear grinding machine is given; secondly, the tooth surface equation of the spiral bevel gear considering the machine-tool motion axis error is established; then, in view of Powell's dog leg optimization algorithm, the tooth surface considering the motion axis error of the machine tool is optimized, and the optimal cutting parameters of spiral bevel gear tooth surface machining are obtained. Finally, the simulation results show that the difference between the peak and peak values of transmission error and the maximum contact stress of the tooth surface is reduced by 72.6% and 1.62%, respectively, and the meshing efficiency is improved from 0.9798 to 0.9803 after optimization; by comparing the rolling experiment and simulation results, the maximum error between the quantitative parameters of the two groups of tooth surface contact marks is no more than 9%, which verifies the effectiveness and feasibility of this method, and provides a certain theoretical basis for practical production and processing.