You can sometimes transit through a Canadian airport without a visa or when you are inadmissible if the airport has direct connection between international and the US departure terminal which doesn't require you to clear the CBSA post. Google on "Canada & TWOV"