No, because a surgical mask is not designed for this purpose, as these masks filter from inside to outside.
Surgical mask sare worn by doctors and dentists to help protect other people and the environment from the mask-wearer by trapping respiratory droplets. In case of COVID 19 the purpose of such masks, according to CDC, is to be used from those who are already ill to avoid spreading the virus around. Surgical masks are not the same as N95 respirators. N95 respirators are special tightly fitting masks that filter out viruses and bacteria. Health workers use N95 respirators at risk of inhaling infectious and other harmful particles, need to be professionally fitted and are not recommended by the CDC for members of the public.