The standard sequence in both الحج and العمرة is الطواف first, then السعي. For العمرة, all four schools agree that السعي must follow الطواف — this sequence is an integral part of the ritual. Performing السعي before الطواف in العمرة would mean you need to redo the السعي after completing الطواف.
For الحج, there is more scholarly discussion. The Hanbali school allows some flexibility: if a الحاج has already performed الطواف al-Qudum (the arrival الطواف), they may perform السعي after it. They may also, عند some Hanbali scholars, perform the السعي of الحج on the Day of عرفة before performing الطواف al-Ifadah. This is based on the hadith where النبي (صلى الله عليه وسلم) was asked on the Day of Sacrifice about performing rituals out of order and said: 'Do it, and there is no harm.'
The Hanafi, Maliki, and Shafi'i schools maintain that السعي must always follow a preceding الطواف, whether it is الطواف al-Qudum or الطواف al-Ifadah. If someone performs السعي without a preceding الطواف, it is not counted and must be repeated. For practical purposes, following the standard sequence (الطواف then السعي) is the safest approach accepted by all schools. If you find yourself in an unusual situation, consult a knowledgeable scholar present at the Haram.