We use hybrid density functional calculations to assess $n$-type doping in monoclinic $({\mathrm{Al}}_{x}{\mathrm{Ga}}_{1\ensuremath{-}x}{)}_{2}{\mathrm{O}}_{3}$ alloys. We focus on silicon, the most promising donor dopant, and study the structural properties, formation energies, and charge-state transition levels of its various configurations. We also explore the impact of carbon and hydrogen, which are common impurities in metal-organic chemical vapor deposition (MOCVD). In ${\mathrm{Ga}}_{2}{\mathrm{O}}_{3}, {\mathrm{Si}}_{\mathrm{Ga}}$ is an effective shallow donor, but in ${\mathrm{Al}}_{2}{\mathrm{O}}_{3}\phantom{\rule{4pt}{0ex}}{\mathrm{Si}}_{\mathrm{Al}}$ acts as a $\mathit{DX}$ center with a ($+/\ensuremath{-}$) transition level in the band gap. Interstitial hydrogen acts as a shallow donor in ${\mathrm{Ga}}_{2}{\mathrm{O}}_{3}$ but behaves as a compensating acceptor in $n$-type ${\mathrm{Al}}_{2}{\mathrm{O}}_{3}$. Interpolation indicates that Si is an effective donor in $({\mathrm{Al}}_{x}{\mathrm{Ga}}_{1\ensuremath{-}x}{)}_{2}{\mathrm{O}}_{3}$ up to 70% Al, but it can be compensated by hydrogen already at 1% Al. We also assess the diffusivity of hydrogen and study complex formation. ${\mathrm{Si}}_{\mathrm{cation}}\text{\ensuremath{-}}\mathrm{H}$ complexes have relatively low binding energies. Substitutional carbon on a cation site acts as a shallow donor in ${\mathrm{Ga}}_{2}{\mathrm{O}}_{3}$, but can be stable in a negative charge state in $({\mathrm{Al}}_{x}{\mathrm{Ga}}_{1\ensuremath{-}x}{)}_{2}{\mathrm{O}}_{3}$ when $x>5%$. Substitutional carbon on an oxygen site (${\mathrm{C}}_{\mathrm{O}}$) always acts as an acceptor in $n$-type $({\mathrm{Al}}_{x}{\mathrm{Ga}}_{1\ensuremath{-}x}{)}_{2}{\mathrm{O}}_{3}$, but will incorporate only under relatively oxygen-poor conditions. ${\mathrm{C}}_{\mathrm{O}}\text{\ensuremath{-}}\mathrm{H}$ complexes can actually incorporate more easily, explaining observations of carbon-related compensation in ${\mathrm{Ga}}_{2}{\mathrm{O}}_{3}$ grown by MOCVD. We also investigate ${\mathrm{C}}_{\mathrm{cation}}\text{\ensuremath{-}}\mathrm{H}$ complexes, finding they have high binding energies and act as compensating acceptors when $x>56%$; otherwise the hydrogen just passivates the unintentional carbon donors. C-H complex formation explains why MOCVD-grown ${\mathrm{Ga}}_{2}{\mathrm{O}}_{3}$ can exhibit record-low free-carrier concentrations, in spite of the unavoidable incorporation of carbon. Our study highlights that, while Si is in principle a suitable shallow donor in $({\mathrm{Al}}_{x}{\mathrm{Ga}}_{1\ensuremath{-}x}{)}_{2}{\mathrm{O}}_{3}$ alloys up to high Al compositions, control of unintentional impurities is essential to avoid compensation.