The axiom of global choice is sufficient. More generally, any proper class ring whose elements can be enumerated along the ordinals will have a maximal ideal. The argument is the usual one...

Suppose $x_\alpha$, $\alpha \in \mathrm{Ord}$, enumerates the elements of the proper class ring $R$. Without loss of generality $x_0$ is the zero of the ring $R$. Define $h(0) = 0$ and for each $\alpha \gt 0$, let $h(\alpha)$ be the first ordinal $\eta$ (if any) such that $x_\eta$ is not in $I_\alpha = \sum_{\beta\lt\alpha} Rx_{h(\beta)}$ and $Rx_\eta + I_\alpha \neq R$. These $R$-ideals are all *uniformly* definable from $R$, $\langle x_\alpha\rangle_{\alpha\in\mathrm{Ord}}$ and $\langle h(\beta)\rangle_{\beta\lt\alpha}$, so there is no trouble carrying out this construction in NBG. The elements indexed by the function $h$ will enumerate a (not necessarily proper) class of generators for a maximal $R$-ideal.

Since the issue is choice, a counterexample in the absence of global choice could be done by extending the ideas of Hodges in Six Impossible Rings [J. Algebra 31 (1974), 218–244; MR0347814] to proper classes. This seems plausible but I strongly suspect that nobody has ever done it in public...