Dijet azimuthal correlations and conditional yields in $pp$ and $p+\mathrm{Pb}$ collisions at $\sqrt{{s}_{NN}}=5.02\phantom{\rule{0.16em}{0ex}}\mathrm{TeV}$ with the ATLAS detector