Of course it's legal people both documented and undocumented do it all the time.
However, they might not receive any credit at all by claiming you.
The credit that our parent's would most likely receive depending on their income/number of children under 17 that they are claiming is the Additional Child Tax Credit. For this one you don't have to have an SSN a dependent holding an ITIN would be eligible as well as long as they meet the guidelines.
If you are older than 17 you would pretty much just be another exemption on their return.
There's also EIC or Earned Income Credit but in order to receive that one everyone has to have an SSN, meet income requirements, filing status requirement, etc.