To say for certain whether you have to go through immigration when transiting flights in HKG or Singapore we'd have to know more about the particular flights and airlines and maybe whether you have checked luggage.
HK doesn't stamp passports but you do get a small entry slip.