Is it possible to dynamically run code inside actor/global actor?

The question is rather terse... so it's hard to know what exactly you mean.

Recovering static isolation information from dynamic in a synchronous function is done by assumeIsolated: swift-evolution/proposals/0392-custom-actor-executors.md at main · apple/swift-evolution · GitHub

Otherwise, just write a function on the actor and call it.

There's soon going to be ways to "start Task on an actor" `@isolated(any)` function types if that's your question.