An acid corrodes metal because almost all the acids accept the electrons that are received by them through a compound. This means that they are strong oxidizing agents.

In case of litmus when electrons are accepted by acids ( given by litmus ) they change their colour instead of corroding . And just the opposite is experienced by litmus in case of bases , the electrons are donated by bases.