Canadian immigration/customs is done at the first entry point in Canada. Canada doesn't operate any pre-clearance facilities.
The US has pre-clearance at major Canadian airports (and like Ireland and some Caribbean islands) so on the way home, for example, you'd clear US immigration in Calgary before heading back to Chicago.