It is considered rude and vulgar for a Polish lady to greet a male before greeting his spouse.
But protocol takes precedence over social norms on state occasions. You Americans don't understand these things of course, 'we're all just folks' :D However on state occasions precedence is determined by official rank and not by gender. Mrs Trump has no official rank so the correct form is either:
The hosting head of state greets visiting head of state, then greets wife of visitor, then wife of host greets visiting head of state followed by wife of same.
Host greets visiting head of state, wife of host greets visiting head of state, host greets wife of visitor and then wife of host greets wife of visitor but either way 'wife of visiting head of state' comes last.
You can see why Mrs D got a bit confused! 'Tell me again who I'm supposed to be greeting now??' It's a bit like Danny Kaye and the famous Chalice from the Palace, the Flagon with the Dragon and the Pellet with the Poison in the Vessel with the Pessel.