The answer is yes and no. It depends on how high in their needs’ hierarchy they place connection.
Generally speaking, people are social species and from the old days, we needed each other to survive. It is recorded in our subconscious that we need connection.
However, what happens in our childhood and life experience is that we sometimes experience so much pain as a result of connection or lack of connection with others that at some point we've decided that:
a) we must have and hold onto connection no matter what
b) we don’t need connection, we are fine on our own.
Both cases above are extremes and emotionally healthy people would be somewhere in between. They would want to have a connection, but they would also have personal boundaries (things that they are willing or not willing to accept and do) beyond which they would say that “if I need to do X, I would rather be alone”. Or “if I need to accept X, then I rather be alone”. And what those thongs are dependent on personal beliefs, self-respect, self-esteem, and also security and being confident that if you lose this particular connection, you will find another one.
On the extreme end of a), the connection might be just as important as food and water: when you think about it like that, it is easier to understand their behavior.
The fact that you asked this question tells me that you have witnessed someone doing things that you probably wouldn’t do in order not to be alone.
It all depends on where in their “priority shelf” not being alone sits. In other words, to answer in one sentence - some people would, and some people wouldn’t, it depends on their internal “software” and what is driving this need.
Kindest wishes to you, my fellow human being,