In the United States, no. There's a law called "the law of perplexities" that says that a trust fund cannot last longer than a specified amount of time after the death of someone living at the time you create the trust. The length of times varies from state to state. In my home state of Michigan, it's 21 years. I haven't checked the laws of every state but I think 21 years or so is common. I was just checking up other states and I find that in Alaska it's 1000 years! That might be close enough to "forever" for your purposes.
I think the reason for these laws is that the government doesn't want to allow a situation where huge amounts of money are tied up in trust funds created generations ago, and where the present population is bound by the terms of a trust that may be totally outdated. Or that were foolish when the trust was set up, that lots of people could have told the person creating the trust were foolish, but he did it anyway and now we are stuck with them forever. Like suppose some very rich person 200 years ago was concerned about the plight of escaped slaves. So he left his multi-million dollar to a trust that will pay out money to help escaped slaves. Well now it's been 150 years since was abolished 150 years ago, but the terms of the trust don't consider that possibility, and so there's this fund that's grown to billions of dollars and the only people benefiting from it are the people who run the fund.
If every generation keeps putting money into trusts, and there's no way to end them, then we could get to a point where 90% of the wealth of the country is in trusts, and our economy is ruled by trust documents written hundreds of years ago and that there's no way to change.
Why not just donate the money to the charity? If you don't trust them to manage a one-time donation wisely, why would you trust them to manage money spread out over time? (Or maybe that's not the issue.)