Canada has two programs for transiting without visa between the U.S. and third countries:
For both programs, you need to have a valid U.S. visa, arrive in Canada on certain approved airlines, transit through Vancouver or Toronto terminal 1, and for China Transit Program transiting to the U.S., you need to arrive from certain cities.
From your comments, you say that it is for a Romanian and a Chinese national. The Chinese national could use the China Transit Program if they meet the above requirements. The Romanian national is out of luck; Romania also doesn't have visa waiver access to Canada, so will need a transit visa.
In reality, you only need to go through Canadian immigration when transiting from the U.S. to a third country. When transiting from a third country to the U.S., you never go through Canadian immigration -- you directly go through U.S. immigration pre-clearance (unless you arrive outside its operating hours), so in that case you may be able to get away with not having a Canadian transit visa, even though the rules say you need it (if the airline lets you on the plane in the first place that is).