Your own block diagram espouses most of the ideas I will describe here. Your circuit, by accident or by design, is actually rather good. Rather than just saying "yes, your circuit will work", let me tell you why it's good.
There's no isolation if you are using the same 12V source to power both pump and controller, they necessarily have to share the same ground, and the same positive supply rail. Placing an opto-isolator between the two would do nothing to isolate them electrically.
If the power sources for each were different, then the opto-isolator would permit you to keep the grounds (and everything else) completely isolated. This is not the case here.
If there is appreciable distance between the controller and pump systems, and there is current flowing through the common ground conductor between them, then there will be a potential difference between its two ends, due to its resistance. The greater the distance, or current, the greater this "ground potential discrepancy" will be.
This is problematic if the control signal cables do not develop the same potential difference, as they would not, since they do not carry comparable current. Digital logic thresholds at each end, which are produced relative to one ground potential, but sensed relative to a different, remote ground potential, can be misinterpreted. A lot depends on the location of the supply:

simulate this circuit – Schematic created using CircuitLab
With power sourced near the controller (top), motor current has to traverse the long cables, which develop a significant potential difference, and the remote motor sees a control signal that looks like 4V, not 5V, as shown on VM1. VM2 (bottom) shows how this is mitigated by locating the power source at the end where most current is needed, the motor, since much less current traverses the connecting wires.
Pump motor current will be changing all the time, developing a "noisy" difference between ground potentials at each end, which will appear as a noisy control signal from the perspective of the receiver. On top of that, you may have currents in the signal wires induced magnetically from proximity to the motor's spinning magnets, and electromagnetically from motor commutation and RF pickup, and electrically from any number of other sources. The longer the signal wires, the greater these problems.
Therefore, the chief concern here is to what degree these issues exist for you, and whether an opto-isolator would even help.
By sharing the same 12V source to power everything, electrical influence of the motor on the +12V and 0V lines is of concern, since this will find its way to the controller via the supply lines, regardless of whether or not you isolate. There doesn't seem to be much benefit from isolation. The main measures you take will be to do with mitigating the motor's messing with that supply, or messing with communications, and isolation isn't much help with either, except in an unexpected way that I'll describe in a moment.
A lot of this is moot if the two systems are situated right next to each other, and power cables to the motor are fat enough, but you didn't tell us anything about that.
There are advantages to using an opto-isolator, which have less to do with isolation, and more to do with signal integrity. A 5V or 0V control signal sitting on a long wire will be disrupted, and at the motor end you are likely to see a lot of noise, and levels quite different from the 5V or 0V you expected, for the reasons I explained above.
A common technique to mitigate induced noise and level issues is to employ a moderately strong current loop, perhaps 10mA, using two wires instead of a single-ended (ground-referenced) potential on a single wire. An opto-isolator, like the 4N25 is ideally suited to this arrangement, if we power its LED with that loop of current:

simulate this circuit
Here the 4N25's LED is placed within the current loop, 10mA being enough to overwhelm any magnetically induced current. To prevent small induced currents from illuminating the LED slightly, I included R4 as a "preferred" path for such current.
The 10mA wire pair, as long as they are close and parallel to each other, will pick up the same electrically induced noise, and the LED will "see" only the difference, effectively cancelling any noise. It also doesn't care what the absolute potentials are, their relationship with any ground anywhere, since it is only potential difference that matters, not any absolute potential.
There is of course electrical isolation directly between the switching element (MOSFET M1) and controller, and this does provide a great level of protection to the controller, from anything that might go wrong at the motor end. While I have perhaps insinuated that electrical isolation is of no use, that's not strictly true; it does have this benefit, also.
I haven't drawn in any capacitors you might need for the 7805 regulator. Get that information from the datasheet, and follow those instructions to the letter.
I have included supply decoupling capacitors close to the controller and the motor/MOSFET elements. The motor must have a source of energy to comply with sudden changes in current demand, changes to which the inductive supply wiring cannot immediately respond. These are C2 and C3. Do not omit them. The same goes for the controller, and any other ICs or modules at the other end. C1 decouples the controller's supply, helping to keep voltage steady there in spite of fast current transients everywhere, even inside the controller itself. The rapid switching on and off of an LED is easy to overlook, I initially did, by forgetting C4. An LED seems so harmless, but a sudden increase or decrease of only 10mA demand can seriously perturb a supply rail with no decoupling.
Lastly, do not share any length of supply-current-carrying cable between controller and motor sections. The power supply cables for the motor and its switching element (MOSFET M1 in my example) should be directly from battery (or whatever source you are using) to motor/switch. Likewise, supply cables for the controller section should be directly to the battery. There should be as little "shared length" of power supply wiring as physically possible.