No other country has the Posse Comitatus Act.
The Act prohibits members of the Army from exercising nominally state law enforcement, police, or peace officer powers that maintain law and order on non-federal property (states and their counties and municipal divisions) within the United States.
I assume this law would be scrapped if we were attacked by Mexican forces crossing the border. However, the National guard is different story.
The Posse Comitatus Act does not define defending the border as law enforcement. Controlling the border as LE has been defined by the leftists who don’t want it secure.