You can marry, here or in another country, with no problems, even if you are illegal, and the marriage will be legal, but it will not affect your immigration status.
You cannot apply for legalization while you remain in the US, and your previous unlawful presence prevents you from legally re-entering the US for 10 years whether married or not.
But If you marry in the US, or elsewhere and return to Mexico, you can apply for a waiver of the 10 year ban, which they may or may not approve, and which takes them about a year to decide. You will have to remain in Mexico during that time.
You must apply for the waiver in a country in which you have lawful residence, so Canada would not work unless you obtain lawful residence in Canada first. Please talk to an immigration lawyer before you decide.
former immigration agent.