The same thing applies if belgium decides to conquer a few more miles of land. You can leave the EU, no state leaves the USA.
Whether a leaving EU party would remain part of a treaty would depend on whether it was individually named. The UK for example is having to negotiate all trade deals anew as current ones are EU only.
Also, no; the EU cannot send troops to the UK. Individual member states could do so, but not the EU. That may change in the future but at the moment it is how it is.
I don't understand the Ukraine reference; in context it seems like you are saying they tried to leave the EU and the EU sent in troops, but that didn't happen. Could you elaborate?
As I said there might be technical legal differences, but practically speaking at this level they can be ignored. If Texas wants independence, it isn't going to be put off by US laws. The US will loudly point to those laws yes, but whether it does anything will be independent of those laws.
Theres nothing stopping the US adding a state.