No. The main idea is to find a $q$ on $S$ that is the sum of squares, but where the expressions being squared are not linear combinations of the coordinates in ${\bf R}^n$.

Consider the space curve
\begin{align*}
S &:= \{ (x,x^2,x^4): x \in {\bf R} \} \\
&= \{ (x,y,z) \in {\bf R}^3: y-x^2 = z - y^2 = 0 \}
\end{align*}
(an incomplete moment curve). The quadratic polynomial
$$ q(x,y,z) := y - 2z + yz $$
is non-negative on $S$, since we have a representation as a square
$$ q(x,x^2,x^4) = x^2 - 2x^4 + x^6 = (x-x^3)^2.$$
The point here is that the expression $x-x^3$ inside the square is not a linear function of the three coordinates $x,x^2,x^4$, preventing any obvious way to extend $q$ as a sum of squares of linear polynomials on all of ${\bf R}^3$.

Indeed, if $\tilde q$ is a quadratic polynomial that agrees with $q$ on $S$, then
$$(\tilde q-q)(x,x^2,x^4) \equiv 0$$
which on expanding the quadratic polynomial $\tilde q-q$ into coefficients reveals that $\tilde q-q$ must take the form
$$ (\tilde q-q)(x,y,z) = a (y-x^2) + b(z-y^2)$$
for some scalars $a,b$. Hence
$$ \tilde q\ (x,y,z) = a(y-x^2) + b(z-y^2) + y-2z+yz.$$
But this polynomial is linear in $z$ and not independent of $z$, and thus cannot be non-negative on ${\bf R}^3$ regardless of what values one assigns to $a$ and $b$.