Yes.Here is simple answer , Pakistan and Iran both are economically weak states, it is fact both lands been used by others. Indian used Iranain land under the cover of construction companies to hit inside Pakistan, mainly Quetta and Gawadar. And Isreali used Pak land under CIA agents cover to hit inside Iran, where they killed political and people linked to nuclear field. We discuss this issue many times with proves. Both side suffered enough. Time to move on .
You never know its Israel-India joint operation on both side .
Pakistan and Iran never had a rivalry except in the 1990s in Afghanistan where the two countries were on the opposite sides--and so were Pakistan and Turkey!
Iran is/was an expansionist regime while Pakistan had no interest beyond safeguarding Pakistan's interests against India--a formidable tasks. Iranians know that and the world knows that. This is an essential truth which I guess all foreign policy planners in most countries know and that's what informs their foreign policies wrt to Pakistan.
But, as you said, both are weak countries and are susceptible to outside incursions. Iranians have a semi-justified suspicion of Pakistan because of Pakistan's close alliance with the Arabs and, until recently, with Washington and by extension with Iran's mortal enemies the Israelis. And Pakistanis are also justified to suspect the Iranian motives considering Iran after 1979 had started to use sectarianism in Pakistan to advance the Iranian goals.
Until great powers like China and Russia offer iron clad assurances to both countries to bring them together, I foresee the mutual distrust to continue.
India and it's role in Iran is miniscule in this debate. Indians can be easily kicked out of whatever little presence they have in Iran--and Iranian leadership have time and again clearly spoken about Kashmir, to give you an idea where India stands in Iran