There is lots of evidence that wearing mask protects others, that's why surgeons wear surgical masks during surgery.
Surgical masks are not intended to protect the wearer, you need medical respirator for that. The question is how effective they are in doing job they are not designed to do. It seems to be limited, maybe around 30-50% depending on the study.
There is a lack of evidence for the effectiveness of masks during surgery, and they aren't always mandatory to wear:
https://www.cochrane.org/CD002929/WOUNDS_disposable-surgical...
https://www.medpagetoday.com/infectiousdisease/infectioncont...
https://ncbi.nlm.nih.gov/pmc/articles/PMC4480558/
There are obvious hygienic benefits - no-one wants to be splashed with bodily fluids - but there is a lack of evidence that they actually protect the patient.