There is no definitive study that shows this. We are all conditioned to believe this. It seems reasonable. Surgeons wear them for infection control. So they must be good.
According to this:
"Unmasking the surgeons: the evidence base behind the use of facemasks in surgery"
J R Soc Med. 2015 Jun; 108(6): 223–228.
doi: 10.1177/0141076815583167
There is not much scientific evidence behind them, it's mostly tradition.
There is also this abstract that indicates NO statistical difference in post surgical wound infections in surgeries performed with masks or without masks:
https://pubmed.ncbi.nlm.nih.gov/1853618
"Postoperative wound infections and surgical face masks: a controlled study"
World J Surg . May-Jun 1991;15(3):383-7; discussion 387-8.
doi: 10.1007/BF01658736
The main findings from the abstract: "After 1,537 operations performed with face masks, 73 (4.7%) wound infections were recorded and, after 1,551 operations performed without face masks, 55 (3.5%) infections occurred. This difference was not statistically significant (p greater than 0.05)..."
This statement pegged my deception meter:
Masks “have not been proven to protect the patient operated by a healthy operating team.” This does not consider that COVID-19 can be spread by asymptomatic carriers. They may feel healthy, but they may be carriers of infection. If my surgical team walked into the operating room without masks, I would have demanded they put on the masks or risk having their medical credentials eliminated so they couldn’t practice medicine ever again. From the Hippocratic Oath:
“I will follow that system of regimen which, according to my ability and judgment, I consider for the benefit of my patients, and abstain from whatever is deleterious and mischievous.”