A papal dispensation has nothing to do with the doctrine of papal infallibility.
The Pope is certainly capable of error. The Vatican I Council (discussed elsewhere) declared that the Pope was infallible in the matters of faith and morals under very specific circumstances. In all other matters and under all other circumstances, he is believed fallible even by the strictest of Catholic theologians.
That out of the way, the Pope does indeed have the authority to dispense anyone from any rule prescribed by Canon Law. After all, he is the authority that signs any of those rules into law. Hence he has the authority to make exceptions.
This is nothing unusual, nor is it unique to the Catholic Church: A governor of a US State can pardon anyone for anything. So can the President of the United States, as well as the head of just about any country or any organization. It has nothing to do with any of them being incapable of error (just remember the upset Bill Clinton caused in many circles for certain pardons he gave out at the end of his presidency).