Any sturdy box big enough to hold them would work, also when the box is a lot bigger.
You can fill the empty space with something soft, like a piece of clothing you happen to have handy.
The smaller (but still big enough) your box is, the more snug your pair of glasses will sit.
In a sturdy box you can put your glasses in any kind of bag.
When you do not have a box handy, you can also just fold the glasses in a hanky or an other soft piece of cloth you have on you and put it in an outside pocket of your coat (as long as you do not lean against that pocket) or in your shirt pocket, (again when you keep it free from outside pressure) or in a suitable pocket or area of your bag.
If your only box option is rather weak, you can still use it but more like a soft case, fill the open area with something soft and keep the box from getting too tight in whatever space you want to transport it. The filling of the box needs to keep the glasses whole, a weak box itself can not do much of a job.
I always use sturdy glasses cases but I have seen my father who prefers the soft case his glasses came in, in combination with his shirt pocket.