"Titanium, magnesium, and aluminum, being close "chemical cousins", are similar in their chemical behavior - Something that eats aluminum will very likely eat titanium just as well, and will probably also eat (or maybe even cause it to burst into flames...) magnesium. "
As a "thumbnail" generalization the above is a fair assumption.
You ought to be aware, though, that Titanium tubing is used extensively as sea water condenser tubes; ie. Ti is very corrosion resistant in ocean water. You wouldn't want to try that with Al or Mg, what???
Further, Ti is also MUCH more heat resistant than the other two: Ti is used for the skin panels of the SR 71 Blackbird SST, where, at cruising speed the skin gets so hot that Al would turn to the consistency of putty.
Yet, in thin ribbon form Ti will burn just as Mg does.....so be careful with the turning swarf!