Salam Alaikum
Yes we can say salam to a non mahram and reply to their salam too as long as this is not done with a flirtitious intent or leads to chit chat between opposite gender.
Even after if you do say salam the other side assumes you are trying to get fresh and start some sort of chit chat - just tell them "sorry all i did was what Allah has commanded, so please stop, i did my duty as a muslim to bid you salam"