It looks like you misunderstood the definition.
To be more precise, the definition is read as the following.
$$\begin{align}
O(g(n,m)) = \{ f(n,m) : &\text{there exist positive constants }c,
n_0,\text{ and } m_0 \\
&\text{ such that } 0 \le f(n,m) \le cg(n,m)\\
&\text{ for all } (n,m)\text{ such that }n\ge n_0\text{ or } m \ge m_0 \}
\end{align}$$
$f(x,y)\not\in O(g_1(x,y))$
For the sake of contradiction, suppose $f(x,y)\in O(g_1(x,y))$. Then there exist positive constants $c$, $n_0$, and $m_0$ such that $0 \le f(n,m) \le cg(n,m)$ for all $n\ge n_0$ or $m \ge m_0$.
$$ \lim_{m\to\infty}\frac{f(n_0,m)}{g_1(n_0,m)}=\lim_{m\to\infty}\frac{n_0^2 + m^2}{n_0^2 + m}=\lim_{m\to\infty}\frac{\frac{n_0^2}m + m}{\frac{n_0^2}m + 1}=\lim_{m\to\infty}\frac{m}{1}=\infty$$
So, there exists $m_1\ge m_0$, such that $f(n_0,m_1) > cg_1(n_0,m_1)$. This contradicts to the condition that $f(n,m) \le cg_1(n,m)$ for all $n\ge n_0$. Q.E.D.
There is no way to define the big-$O$ notation for functions
on more than one variable in a way that implies all properties commonly used in algorithm analysis. You can read this long paper by Kalle Rutanen, March 15, 2018, O-notation in Algorithm Analysis
(updated) for details. So one has to be somewhat wary using the big-O notation in the case of multiple variables.
On the other hand, if the functions inside the notation are nondecreasing in each variable, then most properties used in algorithm analysis do hold for some natural definitions of the big $O$-notation for multivariate functions. This is the case in the question, when we can be more comfortable. In fact, that paper claims that "computer scientists have used the O-notation correctly intuitively" by providing "a solid mathematical foundation" (quoted from its chapter 7, conclusion).
Exercise 1. Show that $g_1(x,y)\in O(f(x,y))$ and $g_2(x,y)\in O(f(x,y))$
Exercise 2. Show that $f(x,y)\not\in O(g_2(x,y))$.
Exercise 3. Show that $f(x,y)\in O(2x^2+3y^4)$ and $f(x,y)\in O(\max(x^2,y^2))$.