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 use the plant Cassia auriculata to care for the hair or to treat dandruff, so long as its benefit for that purpose has been established by medicine or experience. For the default ruling on things is permissibility, and the default ruling on benefits is that they are lawful.
Nor does it become forbidden merely because some people use it in Hindu offerings or rituals, so long as you use it for a permissible purpose such as care and cleanliness. Your use of it is like benefiting from cattle, which groups of people worship (we seek refuge in Allah from that). Could anyone claim that benefiting from cattle is impermissible for this reason?
Allah Knows best.