The answer really depends on the system under observation. The case given in your question in which change in internal energy is zero even when some work was done by (or on) the system is certainly possible if the system is not thermally isolated (or simple isolated). A system must not be thermally isolated because some heat energy has to transfer between the surroundings and the system, if we want internal energy to remain constant after some change in volume of system is observed.
From the first law of thermodynamics,
$\Delta U=Q-W_{system}$ $\tag 1$
If $\Delta U=0$ then,
$W_{system}=Q$ $\tag 2$
Equation $(2)$ implies that if in a closed (not isolated) system, the system expands, some heat comes into the system from the surrounding to replenish the internal energy lost when the system did some work against external pressure.
From the same equation, it also follows that if due to some external agent the system gets compressed, some heat gets out of the system to relieve the system of the internal energy it gained when the external agent did some work on the system.
In simpler terms, internal energy of the system increases when work is done on the system or heat comes into the system, and decreases when work is done by the system or heat gets out of the system.
If the internal energy has to remain constant, these two factors must work oppositely. Either one should increase the internal energy while the other decreases it.
In open systems, there is no boundary between the system and surrounding. Matter becomes exchangeable. In this case there will be no boundary for the system to perform the work against. The surrounding becomes the system. For open system the terms, $Q$ and $W$, have no significance.
Best Answer
This is really to do with the acceptance of the law of the conservation of energy.
Using modern day units to simplify matters Joule's experiment was used to find how much work had to be done in joules to produced a certain amount of heat in the unit of the day, one calorie.
The calorie was defined as the amount of heat of heat required to raise the temperature of one gramme of water by one degree Celsius and work was defined in terms of a force moving through a distance.
Looking back one now realises that Joule was measuring the specific heat capacity of water but using what he thought were two independently defined units, the joule and the calorie to measure it.
Your constant of proportionality is the numerical link between these two units, $4.2\;\rm J \approx 1 \;calorie$.
If you google "mechanical equivalent of heat" you will find many articles on the subject and for some light relief I suggest the lyrics and the actual song by Flanders and Swann who "explain" everything.