(1) This forum is not intended to be a replacement for reading relevant documentation. It seems quite unlikely that you checked Help > Wolfram Documentation > PrependTo. And that is a prerequisite for posting a question like this.
(2) The documentation for PrependTo
is quite clear on why the first argument needs to be something that can take an assignment. You cannot assign a value to Flatten[{{1, 2}}]
.
(3) It might be easier to understand this related example.
In[3]:= PrependTo[a, 3]
During evaluation of In[3]:= PrependTo::rvalue: a is not a variable with a value, so its value cannot be changed.
Out[3]= PrependTo[a, 3]