A metastable system is described as an ensemble of locally isolated statistically independent centers, with a possibility of one and only one nucleus of a close-to- critical radius emerging on each one of these centers. It is assumed that this event occurs as a result of fluctuations in a heterophase subsystem and leads to the formation of a viable nucleus at a given point in space. The process of the emergence of this nucleus is treated as the first crossing of the potential barrier by a Brownian particle. Proceeding from the principles of nonequilibrium thermodynamics, dynamic equations of bubble (droplet) growth are derived, which correspond to the Onsager relations. These formulas are used as Langevin equations in multidimensional phase space and are related to the respective Fokker-Planck equation whose solution enables one to determine the local rate of emergence of a viable nucleus and, as a consequence, the rate of its emergence in the entire system. An alternative expression is given for the rate of homogeneous steady-state nucleation, which differs from the classical expression by the pre-exponential factor and, in the case where one parameter (radius) may be sufficient, gives close limits of attainable superheat (supersaturation). Given the expression for the nonequilibrium work of bubble (droplet) and the distribution of heterogeneous centers, the obtained result may be readily generalized to the case of heterogeneous nucleation.