You should know that, (1) In a period, from left to right the acidic strength increases that mean basic nature decreases. (2) In a group, from top to bottom the basic nature increases that means acidic nature decreases. Na,Mg,Al and K are present in periodic table like this :-
Group 1
Group 2
Group 13
Period 3
......
Period 4
K
So, you can see Na,Mg and Al are present in same period so the order of basic nature among Na,Mg and Al is Na>Mg>Al. And Na and K are from same group so basic nature of K>Na. So the correct order of oxides Al2O3<MgO<Na2O<K2O