For the immigration applications, am not sure, but for the student or visiting visas yes, they stamp the passport with a certain reference number, the visa office name which is the name of the city of that visa office. they don't write rejected or refused just stamp with date and number as i mentioned and the visa office name.
However it doesn't matter whether they stamp it or not because they record all of your information on an electronic file which they create on their system involved with your reference number and passport information (number, name spelling, date of birth....etc)regardless whether it was for a temporary or permanent visa.
I remeber because i got rejected for a student visa when i first applied to the canadian embassy form my country, and i got approved when i applied again after 2 years from another country which i have been working in, my passport was new but i answered the question whether i have ever applied for any kind of visas for canada, i answered yes and wrote the date and the place of my application rejection.
Finally, i don't think that they stamp the refused passports for the immigration applications because they usually don't ask you to send your passport except for the visa stamping purposes (and in some rare cases for verification purposes too), and they usually refuse immigration applications by sending a rejection letter for the applicants who already have their passports with them.