Tensions between Saudi Arabia and Iran, which began with the kingdom’s execution of a Shiite cleric and escalated with attacks on Saudi diplomatic posts in the Islamic Republic, have countries around the world responding by choosing sides or urging calm.