It would have been at the periphery of either, or else its own empire. That and a lot could have occurred between Alexander’s time (300s BC) and Mohammed’s (600 AD)- 900 years. Someone had to come to dominate that mess eventually- unfortunately, it was Mohammed.
If the Hejaz had been part of the Roman or a Persian empire, ...
True - It may have been more difficult had it been civilized by either the Byzantium (eastern Roman Empire) or Persia. Nevetheless the Sassanid Byzantine wars and the iconoclastic wars in Byzantium weakened both the East and West to the point that the heretical arabs swept through in both directions.