Salaam
Caliph Ali ra was cousin of Prophet Muhammed pbuh . So , if he could marry Fatima , daughter of the Prophet pbuh , looks like marrying mother's cousin is also permissible. But it's better to ask a Mufti to explain the relationship - grandfather's
step-sister's daughter - was father or mother same or they had same foster mother etc.
related verse :
Forbidden to you (for marriage) are: your mothers, your daughters, your sisters, your fathers sisters, your mothers sisters, your brothers daughters, your sisters daughters, your foster mother who gave you suck, your foster milk suckling sisters, your wives mothers, your step daughters under your guardianship, born of your wives to whom you have gone in - but there is no sin on you if you have not gone in them (to
marry their daughters), - the wives of your sons who (spring) from your own loins, and two sisters in wedlock at the same time, except for what has already passed; verily, Allah is OftForgiving, Most Merciful.
( سورة النساء , An-Nisa, Chapter
#4, Verse
#23)