Salam(سلام) in farsi not salom.In ancient times in arab countries they used salam when some body enters the city to prove that he or she is not enemy and to show peace so they used salam.and in farsi we say salamaty means healthiness comes from salam,and it is used in iran and arab countries.
The greeting "Salam"(سلام) or "Shalom"(שלום) is not only to prove that you intend to peace; in ancient culture, especially the Israelite, Shalom meant not only peace or healthiness, it meant also full harmony and completeness. For instance, In the Jewish religious law - the Mishna - it said that it is forbidden to say "Shalom" in a dirty or stinky place like bathroom, since it is considered as one of the names of God.
That's cuz Tajik is a dialect of Persian.
In salam/selam/salom/shalom, its the 2nd vowel that's stressed.
In Persian, only the sound "a" in "ass" and a deeper "o"-like sound exist in a stressed state. The latter is why it's салом in Tajik. Similarly with Uzbek, which is a Turkic language influenced heavily by Persian. In Persian, the regular "ah" sound only exists when unstressed.
Actually, Merhaba comes from the Arabic word "Marhaba" "مرحبا" which literally means "you are wellcome". Salam سلام in Arabic means "peace", and in Islam it is used for greetings when saying "As-salamu Alaikum" translated literally "May peace be upon you". The word "Sulh" صلح is used in Arabic for Pacification, Magistrate, or "making peace". PS, Salam is used in other forms in other Semitic languages such as Hebrew שלום (shalom), Aramaic ܫܠܡܐ (shlamaa), Akkadian (Salmu), and others .