Completely free and everybody is vaccinated because they vaccinate kids in schools, I assume it's the same in every country of the first world.
Rabies is endemic in Ceuta and Melilla in any case. I don't know if people in those places are systematically vaccinated but would be a surprise to me.
About Ceuta and Melilla, there have been efforts to have pets vaccinated for free: https://elfarodeceuta.es/sanidad-vacunacion-gratuita-rabia/