In the pjsip Settings for your trunk, General tab, there is a Context field that defaults to from-pstn. Change that to prepend-zero and your custom dialplan will be executed for all incoming calls on that trunk.
However, this seems very unusual and will likely cause various problems. For example, if you forward a call to a mobile, the caller ID that you send on the outbound trunk will likely be in a format that the trunking provider does not accept.
What country is the system in?
Is the PBX configured to require an initial 0 before dialing an external number? If so, why?