I discovered a couple of years ago that Pamplona is well connected to Madrid, but a "transversal" journey can become complicated.
RENFE trains, as it has been mentioned, are a good option. You need to take a taxi to Pamplona terminal, or a local bus. But they don't go along the Camino.
For buses, you will most probably need a local company, going by way of Vitoria. Not along the Camino, neither.
You can take
Estellesa from Pamplona to Logroño; it is a local company, but has a webpage. It stops in every town and village on the Camino, notably Estella. Landscapes are nice, but as terminals are rather outside the cities, you can only have a glimpse of distant church towers. From Logroño, this again gets difficult; I see only an
ALSA daily service to Burgos. You will need to travel to Vitoria by a local company, and then to Burgos. IMHO, this Logroño option is too complicated, unless you decide to take your travel calmly, visit Estella, spend a night in Logroño, etc. -which is not a bad plan, actually.
Renting a car is obviously always an option.
Buen camino!