There is nothing that would stop this legally (what authority should hinder them?). Things that can be enforced are only limited by practicality.
Any non-EU business worth enforcing such a law against will very likely do business inside the EU (e.g. selling ads to local companies). Any money transferred can then be froozen to enforce this law.
Facebook in particular does business as an Irish company for its EU users, so no problem at all here.