We investigate the behavior of nonequilibrium phase transitions under the influence of disorder that locally breaks the symmetry between two symmetrical macroscopic absorbing states. In equilibrium systems such random-field disorder destroys the phase transition in low dimensions by preventing spontaneous symmetry breaking. In contrast, we show here that random-field disorder fails to destroy the nonequilibrium phase transition of the one- and two-dimensional generalized contact process. Instead, it modifies the dynamics in the symmetry-broken phase. Specifically, the dynamics in the one-dimensional case is described by a Sinai walk of the domain walls between two different absorbing states. In the two-dimensional case, we map the dynamics onto that of the well studied low-temperature random-field Ising model. We also study the critical behavior of the nonequilibrium phase transition and characterize its universality class in one dimension. We support our results by large-scale Monte Carlo simulations, and we discuss the applicability of our theory to other systems.