I’ve heard a fair bit about the role of sectarianism in the Ottoman-Safavid conflicts, with the Ottomans carrying the mantle of Sunni Islam and the Safavids carrying the banner of Shi’ite Islam. Did sectarianism motivate any conflicts or hostility between the Safavids and their eastern neighbor, the Mughals? Also, if sectarianism and Mughal-Safavid hostilities were related, which preceded?
I'll try to answer your question, sorry if it doesn't satisfy you
Not really. The Mughals and The Safavids actually enjoyed a rather friendly relations with each other. Additionally, even though the Mughals were formally Hanafi Sunnis when a dispute arose they were far more inclined to side with the Safavids rather than the Ottomans until the 1630s where both empires became biter rivals.
The friendship between the Mughals and the Safavids goes way back to the days of Babur, when the Safavids supported his endeavor to conquer Transoxiana. After the whole thing failed and he conquered Northern India instead, he sent congratulatory embassy to Shah Tahmasp in 1524 and exchanged gifts with him afterwards. When the Mughals under his successor Humayun were attacked by the Suri Empire, Humayun himself sought refuge in Safavid lands, converted to Shi'ism, and conquered Qandahar with Safavid help. Cordial relations were maintained during the times of Akbar, and he even rejected Uzbek offers for a joint alliance against the Safavids, citing old friendship between the Mughals and the Safavids and the honourable descent of the Safavids. He further explained that even though the Safavids were Shi'a, they were also sayyids (descendants of Prophet Muhammad) and so should not be waged war upon. Even so, he had his own designs on the disputed city of Qandahar, so he had his own suspicions and personal distaste of the Safavids, but his aides like Bayram Khan insisted on friendly relations. Jahangir at first also maintained friendly relations with the Safavids, but there's still a sense of competition between the two empires. I think how the Mughal viewed the Safavids during this era can be summarized by this famous miniature showing Jahangir and Shah Abbas, the ruler of Safavid Persia hugging. They both are hugging, and Shah Abbas was even placed near Anatolia, but he's depicted as shorter, darker, and standing on a lamb, compared to Jahangir which shone bright on top of a lion. It's basically "we respected and liked you, but you kinda sucked with the whole Qandahar affair and how you 'mistreated' our ambassador"
The break of this friendly relations happened with Shah Abbas' attack on Qandahar in 1622. This attack has no sectarian roots, as the city was already disputed for years and this can be seen as a culmination of that. With that, Jahangir no longer considered Shah Abbas as "brother" in his memoirs and approached the Uzbeks, offering assistance against Safavid "heretics". Anxious to prevent further Mughal-Uzbek relations, or God forbid, Mughal-Ottoman alliance (which is very unlikely to happen), Shah Abbas tried to reproach Jahangir by sending him letters and gifts. Patterns of friendly relations and peace seemed to have established, but this definitely left a sour taste for both parties. During Shah Jahan's era, it seemed that friendly relations would be maintained as the rulers of both empires sent congratulatory letters to each other, but the Safavid court received prince Davar Bakhsh, a contender to the Mughal throne ousted after Shah Jahan's ascension. This, along with the Mughal subjugation of various Indian Sultanates formally friendly to the Safavids and diplomatic tensions in Isfahan further intensified the animosity between these two empires. Shah Jahan started to contact the Uzbeks, and even the Ottomans to obtain support against the Safavids. Eventually, in 1638 Qandahar was finally obtained by the Mughals not by force, but because the governor of the city had disagreements with the Shah and defected. However, in 1649 the Safavids reconquered the city.
During the crisis that is Mughal succession war after Shah Jahan's apparent death, the Safavids proclaimed support for prince Murad Bakhsh, promising him troops and even invited Dara Shukoh to follow the footsteps of his ancestor and come to the Safavid War. When Aurangzeb ascended to the throne, relations with the Safavids were maintained, but it frequently riddled diplomatic tensions and mockeries from both sides. By the 1680s, Mughal-Safavid diplomacy reached its lowest point, with the Safavids hosting Aurangzeb's fugitive son Akbar and contacting the courts of Balkh and Bukhara to agitate them against the Mughals with little result. This general state of animosity lasted until the Safavid collapse in the 1730s.
Additionally, i would also add that even though sectarianism certainly played a key role in legitimizing war against the Safavids and sectarian violence certainly sometimes happened, sectarianism rarely becomes the main reason for wars between the Safavids and the Ottomans, which was usually motivated by wider strategic or political issues. Selim I's war against the Safavid was motivated internal unrest caused by the Qizilbash, The war of Nahçıvan in 1532-1555 was motivated by both sides' desire to increase their negotiating power, and so on. Sorry if this goes for way too long!