Peking is pronounced like its written bc its not mandarin beijing for northern capital but cantonese for northern capital.
The world used cantonese before mandarin for few reasons and depending on words. Cantonese was a much larger community overseas so they taught foreigners cantonese words. The other reason for some words is that cantonese is closer to the ancient chinese than mandarin, so some words when they are far back transferred to the west and middle east sound closer to cantonese
While all that is true, it leaves out the history of transcribing Chinese into English. Until pinyin was introduced in the '70s, Mandarin transcriptions also used the "pe" transcription.
It is supposed to be pronounced with soft B. Hard P is from Peking which is cantonese. The rest of the world adopted Peking first before Beijing bc cantonese was the language of most chinese emigrants decades and century ago