The vote to create Israel included many countries, but they didn’t let the Palestinians vote. Curuoislu both Inida and Pakistan (who had recently gotten independence from Britain and had a similar psrtiton happen to them) both voted against it.
I dont think an argument that it was legal could be made if they didn’t bother letting the people who were living there vote on it.