in short my answer is “yes”
the longer version is “yes, as i would salute a Mayor”
it is out of politeness rather than acknowledgement of anything else they have or type of appointment.
In the case of some MPs (8%) they have served in the UK Armed forces (Wikipedia link to the list)
32 (63%) served in the Army
6 (12%) serve(d) in the TA/Army Reserves
1 served in the Navy, while 2 serve(d) in the Navy Reserves
3 (6%) in the RAF
and 2 are listed as SAS
of the 51 listed, 63% are shown as holding officer ranks.
admittedly this is a small number (8%) in the grand scheme of likely chance your local MP is a Armed Forces veteran - however there are more than I expected and found in the list my own MP who I didnt realise is a former Army Officer