"In this school not children study, but parents and grandparents."
Translation:Ebben az iskolában nem gyerekek tanulnak, hanem szülők és nagyszülők.
It will change the meaning but it would be a valid sentence, yes. Just as the English sentence would change if you put definite articles in front of the nouns.
I put Nem gyerekek tanulnak ebben az iskolában, hanem....Since I thought it was the children/parents and grandparents that were emphasized. .