Can two two citizens of a EU country who do not allow same sex marriage marry in another EU country who allows them? Or they must have residence in it?
What matters is the domestic policies of wherever you intend to live and the laws of where you're marrying; it's likely that you could get a marriage, but it won't be recognised at home. For example, while a Greek could marry in France and live in France as an EU citizen, that doesn't mean that returning to Greece would result in the recognition of the French marriage. French law states that same-sex couples may not marry when one or both are from certain countries (official source - in French, as I can't find an English version), but Greeks are not excluded - just as long as your partner isn't Polish, Slovenian, Serbian, Montenegrin or any of the others barred. You could check the marriage laws of other EU countries and I'm sure many will be open to you, but the problem is taking that marriage elsewhere. The EU doesn't have a blanket law about marriage, so you'll have to look into individual countries' laws. So, while you can certainly marry someone of the same sex, you can't have it recognised in Greece yet.
This part are not a law but just bilateral agreements between France and countries furiously against same-sex partnership (or for different religion for Algeria-Tunisia-Morocco). This agreement have been override two days ago by a judge in France for a same-sex French-Moroccan couple who want to get married. France - French court allows gay French-Moroccan couple to wed - France 24 And for European citizens who married in countries who legalize same-sex marriage or civil partnership, the European Union force the others countries who didn’t allow equality of right to recognize such unions, and even give the same advantages. More on the official site of the European Union: EU – Marriages: recognition/registration in different countries – Your Europe
The same website you linked says that same-sex marriages do not have that principle fully applied. The example they gave was a Franco-Belgian marriage under Belgian law. The couple in the example move to Germany and able to have a registered partnership, because that's what Germany offers. Greece offers no such protection and their relationship would not be recognised at all and certainly not as a marriage. The EU has no overall law surrounding the legitimacy of same-sex marriages where national governments have not enacted it.
Equaldex: The Collaborative LGBT Rights Knowledge Base You can't marry in another country if both partners don't live in this country... If one is a citizen there it depends on the country...