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/ 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.