There is a basis of the vector space of the polynomials (in one variable) over any field ... and it is $1, x, x^2, x^3, \ldots$
This is because polynomials are not functions - they are expressions (in a loose sense, e.g. see https://en.wikipedia.org/wiki/Polynomial_ring. This can be formalised in different ways). The main point is that two polynomials are considered equal if and only if all their corresponding coefficients are equal. Thus any finite subset of $\{1, x, x^2, x^3, \ldots\}$ is linearly independent - and obviously every polynomial is a (finite) linear combination of $1, x, x^2, x^3$ etc.
This is all valid regardless of what happens later if you try to substitute the "variable" (symbol) $x$ by elements from the field. In your example, the polynomial $x^2+x$ is nonzero in $\mathbb Z_2[x]$, even if the value of it is zero for each $x\in\mathbb Z_2$.
There is a different concept of a polynomial function, which is the function calculated by a (polynomial) expression. For example, $f(x)=x^2+x$ is a function $f:\mathbb Z_2\to\mathbb Z_2$ and, as a function, it is equal to the zero function. Two different polynomials, as you can see ($0$ and $x^2+x$ from $\mathbb Z_2[x]$) provide you with the same polynomial function.
However, this can happen precisely when the field is finite:
For a finite field $F$ with $q$ elements, the $q-1$ invertible elements make up a (commutative) group with respect to multiplication, so the order of every element divides the order of the group (Lagrange's theorem), i.e. for each $x\in F\setminus\{0\}$ we have $x^{q-1}=1$. By multiplying by $x$, one easily derives from this that, for each $x\in F$, $x^q=x$, so the polynomial $x^q-x$ has a zero function as its polynomial function, even if the polynomial itself is nonzero.
For an infinite field $F$, two different polynomials must provide for two different polynomial functions. Otherwise, their difference would vanish (i.e. have a zero) at every element of the field. Then it easily follows that the difference itself (as a polynomial) is zero. (A nonzero polynomial can have at most as many zeros as its degree!)