Actually, it can, but only really in the situation of chronic renal failure (now more properly called 'chronic kidney disease').
The kidney usually excretes a portion of potassium each day, and obviously in renal failure this isn't possible. In that case, the body relies on the gut to get rid of some of the potassium load - up to 30% of the potassium may be excreted in this fashion.
This is all ruined in the case of constipation, where slow transit time prevents this.
So yes, constipation can lead to hyperkalaemia, in a way. However, it will generally only do so when the kidneys are too hypo-functional to excrete enough potassium.