The Supreme Court ruled in 1869 (Texas v. White) that a state cannot secede.
Similarly, under the laws of the Kingdom of Great Britain, the 13 colonies also couldn't secede: https://en.wikipedia.org/wiki/Proclamation_of_Rebellion
Famously, the laws didn't stop those colonies.
* T&C apply