I am not a lawyer, but to the best of my knowledge:
Yes, it is typically possible for a European company to be owned by a foundation registered in one of those countries. They are typically recognized as entities of their own for such purposes.
But when it comes to tax, it's a completely different story. If you're tax resident in the EU, the tax authorities will typically "look through" the foundation if it's registered outside of Europe. So if you're the beneficiary of the foundation, then they will tax dividends paid from an EU company as if you had received the money directly.
If there's a claim, such as during a divorce, I would also expect an EU court to ignore the foundation.
There's a lot of stuff to be aware of, you cannot be in control of the foundation, and the management of the foundation must not release funds if they find you are being pressured (there's a specific term for this which I can't remember).
The "correct" way to do this if you're involved with the EU, is to use a Liechtenstein foundation, as Liechtenstein foundations are recognized by the EU, but since they're not an EU member, they have strategic advantages.
But they're not cheap (10-15k per year in running costs) and you'll really want to use a good lawyer to set everything up, as tiny details can render the whole structure useless.