Of course you can! The Cloud Function is just to forward data to Firebase Cloud Messaging. At the moment, it is not possible to send messages directly from Flutter code with the Firebase Messaging package. So we go from Flutter code over a Cloud Function to Cloud Messaging.
But Firebase Cloud Messaging has a REST API that you can access: https://firebase.google.com/docs/cloud-messaging/http-server-ref
You don't need Cloud Functions at all!