You probably could, but I wouldn't recommend it. The cornstarch helps to thicken the filling and provides a crystal-clear jewel red filling. The flour would not give your that result.
I have always used my grandmother's raspberry pie filling recipe, which does call for cornstarch. The other ingredients are granulated sugar, almond extract and a tiny pinch of salt.
The recipe has been handed down for generations and I've never seen anyone turn down a piece of this pie.
"As a girl I had zero interest in the stove." - Julia Child
This is real inspiration. Look what Julia became!