It depends on the law that has being violated. Wearing tight clothes is not punishable by execution in Shariah, rather it is something which falls under a Tazir and the ruler has the option to choose what punishment to give depending on the circumstances of the case. And here exile could be an option. See Is there an legal punishment for not wearing hijab according to sharia?.
On the other hand, there are some crimes (which fall under Hudud and Qisas) where execution is obligatory once certain conditions are fulfilled (such as adequate evidence being established). These for example include murder, adultery, apostasy etc. Here the miscreant can only be punished by execution and it is not permissible to only exile them. The reason is that for these crimes execution is ordained by scriptural texts and not following them is not an option. The following verses were specifically revealed about changing punishments for crimes that have been fixed by Allah (see hadith):
ومن لم يحكم بما أنزل الله فأولئك هم الكافرون
And whoever does not judge by what Allah has revealed - then it is those who are the disbelievers.
— Quran 5:44
وأن احكم بينهم بما أنزل الله ولا تتبع أهواءهم
And judge, [O Muhammad], between them by what Allah has revealed and do not follow their inclinations
— Quran 5:49