Burning of Magnesium in air is a Redox reaction. Red-ox reaction is a reaction in which one of the elements/compounds loses electrons and the other gains electrons.
In case of Magnesium, it reacts with oxygen to lose 2 electrons to form Mg2+ and Oxygen gains 4 electrons to form 2O2-
The reaction is:
2Mg + O2 -> 2[Mg2+] [O2-]
In fact both of them are examples of redox reactions.
Burning of magnesium: 2Mg + O2 -----> 2MgO
Here, oxidation number of Mg changes from 0 to +2 and that of oxygen changes from 0 to -2. So this is definitely a redox reaction.
Corrosion of iron to iron (III) oxide:4Fe + 3O2 -----> 2Fe2O3
Here, oxidation number of Fe changes from 0 to +3 and that of oxygen changes from 0 to -2. So this is also a redox reaction. Also please see the comments and other reactions associated with rusting in the given link.