Your best option is to leave Canada to resolve your illegal status before deportation. If you are from visa exempt country, you may be able to re-enter.
Consult with a lawyer.
Applying outland while in Canada without status is risky, as it could delay your application or worse.