If a man walks in front of the worshipper it does not interrupt his prayer, but it detracts from its reward. Animals passing in front of the praying person do not interrupt the prayer.
The Sunnah indicates that the one who is praying should prevent anything or anyone who wants to pass in front of him even if they are not one of those three, neither a dog nor a woman nor a donkey.
It is Sunnah for the believer to put something in front of him before he prays, such as a chair or a spear that he sticks in the ground, or a wall or pillar that he faces towards when he is praying so that nothing will pass in front of him that could interrupt his prayer.