Metallic oxides are basic in nature because they react with dilute acids to form salt and water. They also react with water to form metal hydroxides which are alkaline in nature because these metal hydroxides release OH- ions in solution.
On the other hand, if you look at non metallic oxides, they react with water to form acidic solutions which liberate H+ ions in solution. Therefore, non metallic oxides would be acidic in nature.
This can also be proven by the litmus paper test where metal oxides when reacting with water will form strong bases and turn red litmus paper to blue. On the other hand, non metal oxides reacting with water will form strong acids that turn blue litmus paper to red.
example for non metallic
Carbon burns in air to form carbon dioxide:
carbon + oxygen → carbon dioxide
Sulphur burns in air to form sulphur dioxide:
sulphur + oxygen → sulphur dioxide
example for metallic
magnesium +oxygen=>magnesium oxide
2Mg +O2 = 2MgO