Let the cube be of side $a$.
$O(0,0,0), D(a, a, a), B(0, a, 0), G(a, 0, a)$
then equation of $O D$ and $B G$ are $\frac{x}{a}=\frac{y}{a}=\frac{z}{a}$ and
$\frac{x}{a}=\frac{y-a}{-a}=\frac{z}{a}$, respectively.
Hence, angle between $O D$ and $B G$ is
$\cos ^{-1}\left(\frac{a^{2}-a^{2}+a^{2}}{\sqrt{3 a^{2}} \cdot \sqrt{3 a^{2}}}\right)=\cos ^{-1}\left(\frac{1}{3}\right)$