Answered by Sayyidi Habib Umar bin Hafiz (may Allah protect him and benefit us by him).
Is touching graves a blameworthy innovation, as Imam al-Nawawi mentions?
Doing so may be considered a blameworthy innovation if the person doing so is motivated by an incorrect belief or if it is done in a way that resembles the polytheists. It may also be considered a blameworthy innovation if doing so leads ordinary people who lack knowledge to fall into doing something impermissible. The general principle is that it is disliked unless it is done out of love and longing for the person whose grave it is.
There are several examples of the Companions touching the Prophet’s grave. Sayyiduna Bilal bin Harith al-Muzani pressed himself to the grave of the Prophet ﷺ and kissed it, hoping that the Prophet would intercede and that they would be given rain. He then saw the Prophet in a dream who instructed him to go to Sayyiduna `Umar and to tell him to perform the rain prayer and they will then be given rain and this happened. His actions were witnessed by a number of the Companions and no-one condemned him for doing what he did.
Sayyiduna Abu Ayyub al-Ansari once pressed his face to the grave of the Prophet ﷺ. When he was he was criticised for what he was doing, he said: “I did not come to a stone but rather I came to the Messenger of Allah.”