Canada entered a technical recession in the first quarter as tariffs, weak investment and softer exports weighed on economic growth.