If a base is loose, even completely free of the glass envelope, as long as the wires are not cut, you can glue the base and glass together. I use high temperature epoxy, but I have no idea if that is the best glue to use.
It is not that common for the base to come loose unless a tube is really old. I run 70-80 year old tubes so I am careful. Some not so old Western Electric 300B reissues had weak glue joints so care is needed.
I have never heard of anyone squeezing or pinching a tube so hard as to shatter the glass, but I suppose that is possible. Aside from dropping a tube, the most common accident is inserting a tube incorrectly so that the pins are in the wrong holes. That can happen if the key on the central post, or the post itself is broken off so thar a tube can be inserted even when incorrectly oriented. Some 4-pin tubes, like 300Bs, don’t even have a key and rely on two of the pins being fatter; unfortunately, they are not fat enough that they cannot be shoved into the small hole of most tube bases so that a horrible accident is possible.