Yes, such arrangement is fine. The university awarding the PhD should be in an EU Member State or Associated Country.