  We study the CO(1-0)-to-H$_2$ conversion factor ($X_{\rm CO}$) and the line
ratio of CO(2-1)-to-CO(1-0) ($R_{21}$) across a wide range of metallicity ($0.1
\leq Z/Z_\odot \leq 3$) in high-resolution (~0.2 pc) hydrodynamical simulations
of a self-regulated multiphase interstellar medium. We construct synthetic CO
emission maps via radiative transfer and systematically vary the
"observational" beam size to quantify the scale dependence. We find that the
kpc-scale $X_{\rm CO}$ can be over-estimated at low $Z$ if assuming
steady-state chemistry or assuming that the star-forming gas is
H$_2$-dominated. On parsec scales, $X_{\rm CO}$ varies by orders of magnitude
from place to place, primarily driven by the transition from atomic carbon to
CO. The pc-scale $X_{\rm CO}$ drops to the Milky Way value of $2\times 10^{20}\
{\rm cm^{-2}~(K~km~s^{-1})^{-1}}$ once dust shielding becomes effective,
independent of $Z$. The CO lines become increasingly optically thin at lower
$Z$, leading to a higher $R_{21}$. Most cloud area is filled by diffuse gas
with high $X_{\rm CO}$ and low $R_{21}$, while most CO emission originates from
dense gas with low $X_{\rm CO}$ and high $R_{21}$. Adopting a constant $X_{\rm
CO}$ strongly over- (under-)estimates H$_2$ in dense (diffuse) gas. The line
intensity negatively (positively) correlates with $X_{\rm CO}$ ($R_{21}$) as it
is a proxy of column density (volume density). On large scales, $X_{\rm CO}$
and $R_{21}$ are dictated by beam averaging, and they are naturally biased
towards values in dense gas. Our predicted $X_{\rm CO}$ is a multivariate
function of $Z$, line intensity, and beam size, which can be used to more
accurately infer the H$_2$ mass.
