What is variation in potential in diode w.r.t. to distance from centre of pn junction?
The electric potential is zero at the center of the junction in this case because that is how the author defined it to be. The author could have picked any value, but 0 V is a convenient choice.

Unless you have equal doping on both sides of the junction, the potential difference between the center of the junction and either side is not going to be equal. More of the potential change will occur on the side of the junction with lower doping.

The charge across a pn junction looks something like this:


The electric field across a semiconductor is proportional to the integral of the charge:


The electric potential is the negative integral of the electric field:


Based on this, what is 0 V? It is whatever you define it to be. All voltages are relative.