It is not allowed to plant trees on graves
Question

Some people plant things such as Indian fig trees (Opuntia ficus-indica) on graves, based on the claim that the Prophet SAWS (peace and blessings of Allah be upon him) put that on the graves of two of his companions. What is the ruling on that?.
Praise be to Allah.It is not permissible to plant trees on graves, whether they are Indian fig trees or any other kind, or to sow barley or wheat or anything else on them, because the Messenger did not do that to graves, and neither did the Rightly Guided Caliphs who succeeded him (may Allah be pleased with them). 
With regard to what he did to the two graves when Allah showed him the torment of their occupants, by planting palm stalks on them, this was something that was for those two graves only, because he did not do that with any other graves. The Muslims have no right to make up new acts of worship that are not prescribed by Allah, because of the hadeeth mentioned and because Allah says (interpretation of the meaning): 
“Or have they partners with Allah (false gods) who have instituted for them a religion which Allah has not ordained?” [al-Shoora 42:21]
Majmoo’ Fatawa al-Shaykh Ibn Baz, 5/407 
See also question no. 48958 .