Why can't The Dwarf leave the flask?
Because he had no form on his own. He's basically an essence of God, created from Hoenheim's blood.

If his flask would somehow break, his being would dissipate into the space, and lose his form and living consciousness.

Think of it as a soul with no body. Stuffed inside of a container, if that container would break, the soul wouldn't have anywhere to reside, and leave the world. (Al is a slightly different case, his soul is bound to the seal on the back of his neck).