10s of thousands of religious pilgrims travel by bus between Pakistan and Iran every year. You can just avoid Afghanistan.
They should avoid Pakistan if they can, not Afghanistan. It’s in relative peace while the border region of Iran/Pakistan see regular fighting between Pakistani forces and Baluch separatists[1].
1. https://en.wikipedia.org/wiki/Balochistan_Liberation_Army
Generally the border between Paxistan and India cannot be crossed though. I believe Attari/Wagah is the only place, and it was closed too last I heard.