It depends on the dog, its temperament and its background
Perhaps counter-intuitively, it is the nervous, anxious dogs who you shouldn't really let upstairs. Don't fall into the trap of treating a scared dog like a scared child and thinking it will benefit from being close to you at night - it could well do more harm than good for the dog
I've had rescue dogs who I couldn't let sleep in my room/bed because they would have over-attached and it would have potentially created a separation anxiety issue
My last rescue would pee on my bed if she got stressed, so absolutely had to be kept downstairs
Dogs with guarding tendencies tend to do better if they are kept downstairs or confined to a room, as they feel that is all they have to guard. Once they are given the run of the house, or allowed to sleep upstairs, they see a bigger area they need to guard/patrol, which can lead to them pacing around a lot, or getting quite stressed out when they are told not to
Conversely, the dog I will let sleep on my bed is my take-it-or-leave-it labrador, who only wants my bed for the warmth and squishy duvet, rather than any innate desire to protect me or the house
Ideally, you would want to crate the dog overnight with a nice squishy dog bed within the crate and possibly a towel over the top so it feels safe and den-like, but some dogs will react negatively to this if they've had bad experiences in the past, but they can be trained to see it as a positive thing.
If you don't have doors, baby gates will work for most dogs, and you could even get a playpen to set up at night to keep it away from furniture until you know the dog a bit better and know it isn't destructive