Hi,
The scion (the grafted part) and the rootstock have to be closely related.
Typically, you can graft within the same species.
You can graft mangos onto mangos, apples onto apples and so on.
Grafting within the same genus (eg. Mangifera) is often possible but not assured.
For instance, the species belonging to Citrus are mostly compatible among them. However,
not all Annona species are graft compatible.
Grafting species belonging to different genus are incompatible, except for some exceptions.
You cannot graft mangos onto avocados, but you can graft loquats onto quince, for instance.
You mango will accept other mangos and might also accept mango relatives such as,
kasturi and gandaria.