Middle-order batsman Hafeez top-scored with a solid 61 to help Pakistan post a challenging 273-8 and then grabbed three wickets with his tidy off-spin to restrict Canada to 196.
"Our batsmen and bowlers had good workouts in this game. We did a little bit of experiments by sending Younis Khan up front which allowed some other players to feature in the game," said Pakistan coach Bob Woolmer.
"It was (skipper) Inzamam-ul-Haq's decision to try out Younis as an opener. It is an option, but don't read too much into it. Our main target is the opening World Cup match against the West Indies on March 13."
Canada began the chase on an impressive note when Geoff Barnett (28) and Abdool Samad (27) put on 60 for the opening wicket, but could not keep the momentum against Pakistan's pace-spin combination.
Hafeez was brilliantly supported by seamer Rao Iftikhar who ended an early Canadian flourish with three wickets. Seamer Azhar Mahmood was the other notable wicket-taker with 2-24.
Qaiser Ali scored 37 and Ashif Mulla 31, but Canada never looked like threatening their opponents' total in a game reduced to 48-overs-a-side due to the collapse of a sightscreen. The game was held up for more than an hour.
"It was an exciting game and it showed us how much work we need to put up in the coming matches," said Canadian coach Andy Pick.
"We hope that after the World Cup some fundings come to Canada so that we can meet our expenses for cricket in the development area."
Hafeez was not the only Pakistani batsmen among runs as Inzamam and wicket-keeper Kamran Akmal also made half-centuries.
Akmal built on the efforts of Inzamam (59) and Hafeez, smashing a brisk 56 not out off just 37 balls with the help of four sixes.
Pakistan were struggling at 66-4 after being put in to bat, but Inzamam and Hafeez bolstered the innings with a 93-run stand for the fifth wicket.
The Pakistani captain smashed 11 fours in his 64-ball knock before being caught in the covers off left-arm spinner Sunil Dhaniram.
Hafeez hit one six and five fours in his 71-ball knock.
Canadian seamer Henry Osinde did the early damage with two wickets to eventually finish with 2-41. Former West Indies fast bowler Anderson Cummins and Dhaniram grabbed two wickets apiece.
Pakistan are in Group D with the West Indies, Zimbabwe and Ireland, while Canada are in Group C with New Zealand, England and Kenya. The top two sides from each group will qualify for the Super Eight stage.
Pakistan 273 for 8 in 50 overs (Mohd Hafeez 61, Kamran Akmal 56 n o, Inzamam-ul-Haq 59; Dhaniram 2 for 26, Osinde 2 for 41, A Cummins 2 for 58) beat Canada 196 all out in 46.4 overs ( Qamar Ali 37, Mulla 31, Barnett 28, Samad 27; Mohd Hafeez 3 for 10, Iftiqar Anjum 3 for 23, Azhar Mahmood 2 for 24) by 77 runs.