No, there isn’t a dress code for Petra, but make sure your shoulders and knees are covered, as Jordan is a Muslim country, after all. Make sure to wear comfortable shoes, as you’ll be doing a lot of walking.