In the past few decades, two-dimensional (2D) transition metal dichalcogenides (TMDCs), such as ${\mathrm{MoS}}_{2}$ and ${\mathrm{WTe}}_{2}$, have attracted intensive research due to their unique crystal structure, interesting physical properties, and potential applications in various fields. However, 2D transition metal dioxides with the same crystal structure as TMDCs are much less studied both theoretically and experimentally. Here, we present a systematic theoretical study on the 2D ${\mathrm{RuO}}_{2}$ and ${\mathrm{OsO}}_{2}$ by using the first-principles calculations. It is found that the monolayer ${\mathrm{RuO}}_{2}$ and ${\mathrm{OsO}}_{2}$ both have a 1${\mathrm{T}}^{\ensuremath{'}}$ crystal structure and their stabilities are confirmed by the phonon dispersions and molecular dynamics simulations. The hybrid functional calculations show that both materials are nonmagnetic semiconductors with moderate bandgaps of 0.64 and 0.69 eV for monolayer $1{\mathrm{T}}^{\ensuremath{'}}\text{\ensuremath{-}}{\mathrm{RuO}}_{2}$ and ${\mathrm{OsO}}_{2}$, respectively. When stacking monolayer $1{\mathrm{T}}^{\ensuremath{'}}\text{\ensuremath{-}}{\mathrm{RuO}}_{2}$ and ${\mathrm{OsO}}_{2}$ up into the three-dimensional structures, two stable ${\mathrm{T}}_{\mathrm{d}}$ and 2M phases can be formed, which are also nonmagnetic semiconductors. Interestingly, the ${\mathrm{T}}_{\mathrm{d}}$ phase lacks the inversion symmetry, which possesses sliding ferroelectricity. The calculated spontaneous out-of-plane polarization is 0.16 and 0.33 $\ensuremath{\mu}\mathrm{C}/{\mathrm{cm}}^{2}$ for ${\mathrm{T}}_{\mathrm{d}}\text{\ensuremath{-}}{\mathrm{RuO}}_{2}$ and ${\mathrm{OsO}}_{2}$, respectively. Our work clarifies the crystal structure and electronic properties of 2D ${\mathrm{RuO}}_{2}$ and ${\mathrm{OsO}}_{2}$ and could be helpful for more experimental studies on both materials.