All perfect praise be to Allah, The Lord of the Worlds. I testify that there is none worthy of worship except Allah, and that Muhammad is His slave and Messenger.
It is permissible to say 'Salaam' to a person who is praying, and the latter may respond immediately by pointing with his hand, or by words after he concludes the prayer.
Suhaib said: “I passed by the Prophet while he was praying, and I said ‘Salaam’ to him, and he made a gesture with his hand (as a response to me)”. [Abu Dawood, an-Nassaa'i, At-Thirmithi, and others] At-Thirmithi said that 'it is a sound Hadith'.
Ibn Masoud said: “We used to say ‘Salaam’ (greet) when people pray, and order what we need, so I came to the Prophet while he was praying, I said ‘Salaam’ to him and he did not respond to me. I was sorry for what had happened. When the Prophet finished the prayer, he said: “Allah renews whatever of His matters He wishes, and Allah has brought something new that ‘it is not permissible to talk during the prayer”. Then he replied to my ‘Salaam’. [Abu Dawood, Imam an-Nawawi graded it as Hasan]
Allah knows best.