It depends on a variety of factors. Social distancing might be useful or useless depending on the virus, the ventilation, and other precautions adopted.
Let’s examine each variable one by one.
How useful social distancing is depends on the virus
Social distancing is useful when dealing with viruses that transmit via droplets, such as those we emit when sneezing or coughing. Conversely, social distancing is less useful for airborne viruses (those that can float in the air for long periods, such as COVID).
This doesn’t mean that social distancing is useless; depending on the circumstance, it might be useful or useless.
How useful social distancing is depends on ventilation and exposure time
Let’s forget about viruses for one second and think about smoking instead. If you spend ten minutes in a poorly ventilated room together with a smoker, your clothes will smell like cigarettes regardless of whether you sit close or far from them. Conversely, if you spend ten minutes in a well-ventilated room with a smoker, how much your clothes smell depends on how close to the smoker you sit.
The same applies to viruses. When you spend time with a contagious person, how many virus particles you inhale depends on how much time you spend with them, how far you sit, and how good ventilation is.
Of course, there are extremes on which none of those variables matter – if you spend hours in the same room and it’s not ventilated at all, you will probably inhale enough virus particles to fall sick regardless of whether you sit close or far from the infected person. However, there are also ranges in which those variables matter: if you spend an hour in a moderately ventilated room, sitting far from the infected person might reduce the number of virus particles you inhale to a number low enough for your immune system to fight without falling sick.
How useful social distancing is depends on masking conditions
The same reasoning applies to masking. If neither you nor the infected person are masked, it might be that you will inhale enough virus particles to get infected regardless of whether you sit close or far from them. However, if both you and them are masked, the combination of masks and social distancing might reduce the number of particles enough to enable your immune system to fight the invasion without falling sick.
Conclusion
Social distancing can be useful or useless, depending on many variables. The better the ventilation, the shorter the exposure time, and the more masked people are, the more social distancing is useful.
Social distancing alone is not effective enough to make people safe, but it can significantly reduce risk when combined with other precautions.