Where is the "foreigner" from? Whether or not a marriage can take place/be legal would depend on the laws of that "foreign country." If you're a US citizen & the N. Korean person is living in the US -- yes, a marriage is legal, and the N. Korean would become a US citizen via the marriage.
If that North Korean was still living in North Korea, they would not be able to marry a foreigner. Though, if the North Korean lived in any country besides North Korea, they would most likely be able to marry as long as there isn't a specific law about it.