Upvote:3
You can't extend one country's type D visa in another country.
However, there's nothing that says that Spain or Germany cannot issue a separate visa that commences right when your type D expires. You just have to convince them to do so, same as if you didn't have the type D visa.
That may be easier said than done, though. Spain and Germany are not supposed to issue short-stay Schengen visas unless you apply from your country of permanent residence, which is not Czechia. They can dispense from that in special circumstances, but whether you can convince them that your circumstances are sufficiently special is anyone's guess.
Member states follow their own rules for issuing their own type D visas, which may allow them to entertain applications filed in Czechia. If you can convince one of them to give you a work visa for a summer internship, that would work. No idea how easy that would be -- if you don't even have an employer in mind, let alone an agreement with one, it sounds like an uphill battle.
Finally, though, do you even need a visa for short stays? You don't disclose your nationality in the question. If your nationality is visa-free for short stays, you won't need a separate visa for the summer unless you want to work. The 90/180 day rule for visa-free access does not count days you have spent in the Czech Republic with your Czech type D visa.