We wish to evaluate the sum $$\sum_{k=0}^{n}(-1)^k\binom{n}{k}(x-k)^2=x^2-\sum_{k=1}^{n}(-1)^{k-1}\binom{n}{k}(x-k)^2.$$
Consider an $x\times x$ board, where $x\ge n$ is an integer, in which we want to choose a single square, and the list of properties $\Omega=\{P_i\mid i=0,\dots,n\}$, where the property $P_i$ is "the $i$th row and the $i$th column of the square are empty".
Let $S\subseteq[n]=\{1,\dots,n\}$, then the number of ways to choose a single square on the board that satisfies the list of properties in $S$ is $$N(\supseteq S)=(x-|S|)^2.$$
There are $\binom{n}{k}$ sets $S\in[n]$, so $$N_k=\sum_{S\,:\,|S|=k}N(\supseteq S)=\binom{n}{k}(x-k)^2.$$
Therefore, by the Inclusion-Exclusion Principle, the number of $x\times x$ boards that satisfy none of the properties in $\Omega$ is
$$
e_0(n,x)=\sum_{k=0}^{n}(-1)^k N_k=\sum_{k=0}^{n}(-1)^k\binom{n}{k}(x-k)^2,
$$
exactly the sum we want to evaluate. But any choice of a single square is a choice of 1 row and 1 column, so at most 2 such properties can be violated at the same time. Thus, we have the following.
If $n\ge 3$, then $e_0(x,n)=0$.
If $n=2$, there are $2$ such choices: (row 1, column 2) and (row 2, column 1), so $e_0(x,2)=2$.
If $n=1$, there are $2x-1$ such choices, since the chosen square must be in row 1 or column 1, so $e_0(x,1)=2x-1$.
If $n=0$, there are $0$ such choices, since the board is empty and we need to choose 1 square, so $e_0(x,0)=0$.
Finally, these formulas apply for any integer $x\ge n$, and since $e_0(x,n)$ is a polynomial in $x$, they must hold identically.
This can easily be generalized in various ways. For example,
$$
\sum_{k=0}^{n}(-1)^k\binom{n}{k}(x-k)^m=
\begin{cases}
m!\,, & \text{ if } n=m,\\
0\,, & \text{ if } n>m.
\end{cases}
$$