Politics aside, I see news that former Pakistan's President Pervez Musharraf is in Dubai for few years, I am wondering who pays for his hospital and his family stay?
Officially, they earn a pension for their life, like any government employees. For Non-ministers, the pension and other benefits expire after 4/5 years, depending on the election cycle. (If cycle is 5 years, Ex-MP will get pension for the next 5 years, if he loses. If he wins, he makes the salary)
Many countries constitutions are a first-class copy of British/US governments. So, the laws would be relatable in your nation.
He was a dictator, so he must have made some money, unofficially*. So, those funds could be used too. Also, they get medical aid for their life. (Only Ministers), so the government pays for medical, if the required treatment isn't available in the nation, as per standards*.