If non-Shariah practices are prevalent on the grave of a pious person or a wali i.e. innovations etc then one should avoid visiting such places, since according to Hadith the purpose of visiting the graveyards is to refresh the belief in the world hereafter, but this objective cannot be achieved by visiting a place where shirk or bida’h is committed. Hence one should visit the common graveyard of Muslims instead of visiting such places. It shall remind the hereafter and death as well as one shall feel one’s weakness and powerlessness. It is good practice to visit the graveyards and do isal-e-sawab. It is better to stay outside and do isal-e-sawab at a place where bida’h etc is committed.
Allah knows Best!
Darul Uloom Deoband