Asking for an extension for decision for PhD offer. And masters vs PhD?
You're stuck in a conundrum you'll encounter all through your life: You have a girl/boy friend and you wonder whether it's worth committing and getting married -- but you keep wondering whether anyone better might come along eventually. You have a job offer from a well-paying company, but you still have that application pending with Google. You have a grad school offer from University B but you're still hoping for one from University A.

The point is that sometimes you just have to commit. Your tentative second choice isn't going to wait for you forever while you're trying to figure out whether sometime (or someone) better might come through: Universities, employers, and partners make offers that are only valid for a certain amount of time because they, too, eventually want clarity and the ability to plan going forward. That's just a fact of life.

In your current position, you can of course ask for an extension, but you should be prepared to not get one. You'll then (i) have to make a decision that takes into account how much worse you think option B is compared to option A, and how likely it is that option A comes through, and (ii) find a way to make your peace with your decision. In fact, finding ways to be at peace with your decisions is what I think is the key piece to a happy life in general.