PEK (terminal 3) is quite effective in terms of immigration (much better than US airports) and luggage, but 45 minutes sounds very narrow. But as HKG (and Macao) is considered international you may skip the immigration. But I’m not sure about this.
According to the Star Alliance Travel Desk the “official” connection in PEK to HKG (from SK) is 1:05 hours to CA 109.
Is it a travel agency, which gave you this connection?