If you know that, for health reasons, criminality issues, human rights issues, or security risk reasons, you will be considered inadmissible to Canada, you may apply for a Temporary Resident Permit at the Canadian border which will give you the opportunity to state your case to a border officer.
There are some risks and benefits in applying for a permit at the border as opposed to making an application at a Canadian Consulate in your home country and waiting for an approval. Some of the risks and benefits include,