Ehh not really. One is a cultural thing the other is a state issued piece of legal code.
Sundown towns are real but they’re not really an american specific thing either. Tons of places on the planet will target you based on cultural shit. Closed Cities are some fascist ass shit
edit; a word
I think the conclusion of comparing these two things