I need some clarification on the definition of polynomial equation.
Let $f(x) = \displaystyle\sum_{i=1}^n f_i \,x^i ,\; g(x) =\displaystyle\sum_{i=1}^m g_i \, x^i\in \mathbb{F}[x]$, where $\mathbb{F}$ is a field. We know that $f = g \,$ if $m=n$ and $\forall i, f_i = g_i$. This also normally coincides with the definition of the equality of functions, where $f = g$ if $ f(x)=g(x)$ for all $x$.
However consider the following polynomial over $\mathbb{Z}_2[x]$: $f(x) = x^2 + x + 1,\; g(x) = 1$. These two polynomials obviously do not have equal coefficients however $f(x)=g(x)$ for $x = 0, 1$.
So are these two polynomials equal or different?
You are misunderstanding polynomials and polynomial functions.
Let $p$ be a prime number and let define $f=x^p-x\in(\mathbb{Z}/p\mathbb{Z})[x]$. Using little Fermat's theorem, one has: $$\forall x\in\mathbb{Z}/p\mathbb{Z},f(x)=0.$$ So $f$ as a polynomial function is equal to $0$ over $\mathbb{Z}/p\mathbb{Z}$, but $f$ is not the zero polynomial of $(\mathbb{Z}/p\mathbb{Z})[x]$.
To go back to your example, $x^2+x+1$ and $1$ are equal as polynomial functions over $\mathbb{Z}/2\mathbb{Z}$ but are different polynomials of $(\mathbb{Z}/2\mathbb{Z})[x]$.
What is interesting to notice is that one has the following:
Proof. Since $f-g$ has an infinite number of roots in the fraction field of $R$, $f-g=0$ as a polynomial. $\Box$
This proposition basically tells us that polynomials and polynomials functions behave in the same way over a infinite integral domain.