Can I use fetch in a custom code step?

No, because the custom code environment is a V8 environment, fetch is not available. However, Mesa.request is our replacement for it. You can check out the Mesa SDK for more information on available functions in the custom code step.