If you live in an apartment, getting out of the building can be a challenge - especially for dogs that get excited. A dog dashing down the stairs to greet a person can pull an owner off balance (not to mention what it can do to the other person) or a dog rushing into a small elevator to meet a dog may be not have a lot of room to get away if the other dog doesn’t want to be approached.
An easy way to handle this is to use a hand touch. (Learn how to teach this behavior here. When you get to the top of the stairs or in front of the elevator, put your hand out and ask for a hand touch. You can use it on landings or in front doorways as well.
If you do this every time your walk your dog, he/she will start turning toward you even before you present the cue. I started doing this with my own very excitable dog while I was working on her staying with me. The hand touch made her check-in with me and allowed me to settle her down, reinforce her for calmly walking down the stairs and keep her from being reinforced by the thrill of rushing to greet a person coming up the stairs. I consider it the most important thing I ever taught my dog (and myself) to do.