Heads of states have to be diplomatic to some extent. If they didn't meet other heads of state from time to time international relations would be (negatively) affected.
Ozil is a citizen and doesn't represent anyone. It's up to him if he wants to go and meet the Turkish president. It's not up to the Queen or Theresa May whether they do it, they are obliged to do so.
I suspect, like the Chechen President did with Mo Salah at the WC, Erdogan was just looking for good publicity and got it and Ozil has to deal with the backlash because Germany were hugely disappointing. If they had done well, we'd probably have heard nothing more of it.