Yes, it shouldn’t be a problem as long as the state machine is initialized. Actor components do that by default on their BeginPlay, which should happen before the Actor BeginPlay is called. If you turned off InitializeOnBeginPlay then you need to call Initialize on the component first.
If you’re not using an actor component (I don’t think that’s the case from your example) then you can call your function after the CreateStateMachineInstance function.
I’ll add state machine component template support to the backlog and try to get that in for 2.0.