I never asked for a distance certificate at the Oficina del Peregrino in Santiago and I walked for about 600 km or more before I even knew that one can or does get stamps on the
chemins de Compostelle and on the
Jakobswege so I am not really competent to reply but I reply nevertheless.
I can confirm that you can't get stamps everywhere the further away from Santiago you are. Small businesses like baker's and grocery shops may well have a stamp for administrative purposes but they don't keep the appropriate gear in the shop or store where they serve their everyday customers. If it is important to you you may be more lucky at tourist offices, town halls and perhaps even churches but they may be out of your way or have inconvenient opening times and are simply not worth the time and effort. Post offices may be the most promising stop where to get a stamp but again they may be closed if and when you pass.
Something I did for myself and just for fun: I retraced my steps in Google Earth and I now have a nice visual of my walk from home to Santiago plus a record of how many km I walked because the GE website / app calculates the length of every section that I walked. I assume, without knowing, that it is sufficient to make your distance plausible for the Oficina, you don't have to document every bit of such a long distance with stamps and they may happily accept it when you present them with a credible number of total kilometres walked.
Die Worte
Guter Weg wollen mir einfach nicht über die Lippen kommen, also sage ich wie gewohnt:
Buen Camino!