A theory for metastabilities in bubble nucleation: can it help explaining nanobubbles?