Here is a related (counter)example if we remove the "symmetric" assumptions on $A$ and $B$:
\begin{align}
A &= \left[\begin{array}{cc} 1 & -1 \\
3 & 1\end{array}\right]\\
B &= \left[\begin{array}{cc} 1 & 3 \\
-1 & 1\end{array}\right]
\end{align}
It can be shown that $x^TAx \geq 0$ and $x^TBx \geq 0$ for all $x \in \mathbb{R}^2$, but
$$ \sum_{ij} a_{ij}b_{ij} = (1)(1) + (-1)(3) + (3)(-1) + (1)(1) = -4$$
On the other hand, if $A, B$ are real-valued $n \times n$ matrices that satisfy $x^TAx \geq 0$ and $x^TBx \geq 0$ for all $x \in \mathbb{R}^n$, and if $A$ is symmetric, then the situation is different: We can say $A = R^TR$ for some square matrix $R$ and so
$$ \sum_{i=1}^n\sum_{j=1}^n a_{ij}b_{ij}=trace(A^TB) = trace(R^TR B)= ...$$
so you can use properties of the trace to eventually prove $trace(A^TB)\geq 0$. In particular, the desired non-negativity result holds as long as at least one of the matrices $A, B$ is also assumed to be symmetric.