Why planes have propellers in front but watercraft have them behind?
There are quite a lot of reasons for this, but it's a complicated design environment, and that's why it's not always the case.
Seals and cooling
The inside of a plane's wings is the same fluid as the air around it, but the inside of a boat's hull is a different phase than the water outside. Basically you can never have a rotating shaft over a pressure difference that doesn't permit some fluid through, around the shaft. There are ways to mask this, so that no one ever sees water leaking into the hull. For instance, you can have an intermediate stage between the hull and the water where air is pumped into a higher pressure cavity. Then it's possible that the seal can bubble with air passing out into the water.
Whichever design the ship maker uses you can't change the physical fact that you'll have some fluid flow through the prop seals, be that air or water. This presents a good reason to have the prop on the back of boats and the front of planes. Pressure is higher at the front because of the kinetic pressure of the fluid, and lower at the back for the reverse reason. By putting the prop of a boat in the back you reduce the pressure difference that the seals have to deal with. The plane has no such concern, and might prefer more air pressure and flow around its engines for cooling. In fact, Wikipedia seems to agree with the cooling point for plane engines.
In pusher configuration, the propeller does not contribute airflow over the engine or radiator. Some aviation engines have experienced cooling problems when used as pushers.[33] To counter this, auxiliary fans may be installed, adding additional weight.
Stability
A moving boat or plane has an aerodynamic center of pressure. If this point is behind the point of thrust, then it's a more stable setup and if it's in front then it's a less stable setup. It's likely not a problem either way because there are other dynamical factors that make it stable, or you have a pilot that acts as an active control system.
Nonetheless, planes worry about stability a lot more than boats.
Operational considerations
As others have pointed out, boats logically don't want the prop in the front because you're more likely to hit something (like a sandbar) with the front of the boat, and you don't want to shred things. This quite possibly dwarfs the basic physical considerations.
In fact, as I was thinking about cavitation concerns, it seems clear that the back of the boat isn't the ideal place. Directly under the hull would be superior. But this a) doesn't give a direct shaft line to the engine and b) it could make the prop hit the ground or a whale. For this case, it's clear that the operational safety concerns are much more pressing than a little bit more performance.
Well the issue is relatively simple.
With the boat, all that is required is to propel the boat forward, and that is best achieved by accelerating a mass of water in a direction opposite to the direction of boat travel. That is best achieved by expelling the accelerated water into as unrestricted a space as possible; which clearly is behind the boat. With the propeller in front, the accelerated water has to move around the bow of the boat, so part of the energy is wasted moving the water sideways, away from the hull, and generating no net thrust since the two sides cancel out, so only the component of the velocity along the path of travel is useful in driving the boat.
With an aero-plane, there is an additional interest, namely increasing the lift of the wing, specially at low forward speeds such as at take off and landing. So having the propeller in front, (specially with twins) even at zero speed, the air flow over the wings, provides significant lift, reducing the necessary take off speed, and the possible landing speed. The plane propeller, even with a single engine, has a larger diameter, than the profile of the fuselage, and the propeller is designed so that most of the air movement is generated near the tips, rather than at the hub, so the energy lost to the fuselage drag is minimal.
Pusher propeller planes, or push-pull duals, are quite popular when used on primitive air strips, that may have loose stones on them, so the prop wash is not kicking up stones into the fuselage.
A boat is most efficient when it is riding on a plane. This happens when the boat reaches a certain speed and is essentially lifted out of the water. This can not happen if the propeller were located on the front of the boat. Look up a boat with a hydrofoil and you can see how it works.