It clearly can, it’s not like ChatGPT just refuses to answer if your prompt isn’t exactly word for word the same as something in its training data. Otherwise it would just be a search engine
"Can" is a bit of a stretch imho. It can produce something for every input. Humans are way more accurate in that regard. ChatGPT just feels correct but is mostly wrong.
It’s more that its training objective doesn’t require it to be correct, which is a completely separate thing to whether or not it can generalise to things it hasn’t seen before