Mechanisms of annealing effect in air and vacuum environments on damage threshold of HfO2 optical films used in vacuum was analyzed. The results showed that the laser-induced damage threshold of sample after annealing in vacuum had no obvious change, while annealing in air resulted in damage threshold enhancement. Electrical field effect has no direct effect on improving laser damage. The increase of thermal conductivity after annealing in vacuum has the beneficial effect on increasing the laser damage threshold, which offsets the adverse effect of the absorption increase induced by stoichiometry defects. Annealing in air not only improves the stoichiometry of films, but also reduces the temperature rise as well as thermal stress and deformation during laser irradiation, which in turn increases the laser-induced damage threshold. Pacs42.79.Wc; 81.70.Fy; 68.37.Hk.