Use of svGetScopeFromName

Untill now, I have called svGetScopeFromName within the call chain that has its origin in rtl. My question is that can this function be invoked from the call chain that is not originated from rtl.

Scopes in SystemVerilog are lexical (created at elaboration), they do not involve call chains, which get created during runtime. SystemVerilog has no knowledge of what is considered RTL versus testbench. That comes from a synthesis tool perspective.