Using a VPN is completely legal in Germany, but also in many other countries like Switzerland or Austria. Using a VPN for illegal actions, such as downloading copyrighted media, are of course not legal.