If currently you have an Exchange hybrid deployment and the mail flow rule is created in Exchange Online, it will continue to work without the Exchange on-premises server.
However, please note that if your company would like to keep Active Directory synchronization in place, it is recommended not to uninstall the local server (you can shutdown the server instead).
For more details please refer to this documentation:
How and when to decommission your on-premises Exchange servers in a hybrid deployment
If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.