You can even get prosecuted for things you do outside of Germany if police gets their hands on you.
Most of the time this does not happen due to lack of public interest. Nobody wants to lock you up due to some bat shit post you made on the Internet. Unless it had a very wide reach and was particularly deplorable. And linked to your real identity. And there was an arrest warrant. And you entered German jurisdiction or an allies jurisdiction who extradites for that crime.
This only happens in the thoughts of paranoid people though.