I would skip Dubai altogether if I were you. Easily the most over-hyped and boring place on earth. Besides, Muscat will keep you busy enough for a week easily, especially if you do some touring. The country is easily navigated by rental car and I am sure you can find some interesting city breaks from Muscat.
Petra seems like quite a stretch. Jordon is also a destination in its own right and worth a week by itself.