Does Hall flow sensor require an optocoupler when using STM32 MCU?
Should not be any problem. But you could use a Zener for possible voltage spikes (5.1V for instance).
Also, you need to make sure you are using the 5V tolerant pins, as not all pins of the STM32F103 are 5V tolerant.

Regarding your noise problem, you could try to simply add a small capacitor from signal to ground to suppress some false triggering due to noise. You might also add a pull-down resistor.
Using an Opto Isolator wouldn't make sense since your using the same power supply for both sides.