Background: Pain anticipation has been identified as a predictor of pain and avoidance with respect to endodontic therapy. Self-efficacy is also key to the development and maintenance of health behaviors and achieve patient adherence to treatment. However, the role of self-efficacy has not been studied yet in endodontic treatment. Methods: This study was conducted on 101 patients who needed root canal therapy. They had to fill a questionnaire before treatment registered pain anticipation and self-efficacy; during and after treatment were registered pain intensity and avoidance. Results: Pain anticipation explained pain during (Beta = 0.51, t = 5.82, p ≤ 0.001, [0.34, 0.69]) and after treatment (Beta = 0.38, t = 4.35, p ≤ 0.001, [0.21, 0.55]). Self-efficacy did not have an influence in pain values. Pain anticipation explained avoidance during (Beta = 0.51, t = 3.60, p ≤ 0.001, [0.23, 0.80]) and after treatment (Beta = 0.62, t = 4.29, p ≤ 0.001, [0.33, 0.91]). Self-efficacy had a significant role in avoidance during treatment (Beta = 0.12, t = 2.19, p ≤ 0.03, [0.01, 0.23]) with a strong moderation relationship between pain anticipation and avoidance when self-efficacy was medium (Beta = 0.44, t = 3.24, p = 0.002, [0.17, 0.72]) or high (Beta = 0.84, t = 3.5, p ≤ 0.001, [0.37, 1.33]). Self-efficacy was not significant respect to avoidance after treatment. Conclusions: Self-efficacy is an important variable in endodontic therapy due to their moderating effect between pain anticipation and avoidance behavior during the procedure. It is necessary to improve the results of root canal therapy and reduce patient’s avoidance in order to take into account this variable.