You can definitely do this! There are two ways that readily come to mind:
1. Use the Realtime Database as a communication channel to trigger a Cloud Function that then sets up the thing you need.
2. Create an HTTPS function and call it directly from your app, then do the work you need.