What's the difference between work in thermodynamics and mechanics? What is the difference between work in thermodynamics and work in mechanics?
 A: Actually I think I disagree with the answer by BMS (the group of asymptotic symmetries of asymptotically flat spacetimes?). However I am not sure to have understood BMS'answer completely.
In my opinion, there is no difference between the definition of work in pure mechanics and work in thermodynamics (I stress that I am speaking of thermodynamics and not statistical mechanics). In both cases it is computed by the integral of ${\bf F} \cdot {\bf ds}$, taking all forces acting on the system into account. In the pure mechanical case the theorem of energy conservation says that
$$W = \Delta U + \Delta K\:.\qquad (1)$$
$W$ is the work done on the system by external systems, $K$ its kinetic energy and $U$ the total potential energy of internal forces. When considering situations where the work $W'$ of the system on the external systems  coincides, up to the sign, to the work $W$ done by the external system on the system (and this is not the case discussed by BMS) we can also say that: 
$$\Delta U + \Delta K + W' =0\:. \qquad (2)$$
In real physical systems, one has to consider the fact that a system receives energy also in terms of heat, $Q$: that is energy that cannot be described in terms of macroscopic work. In this case  (1) has to be improved as
$$W + Q = \Delta U + \Delta K\:.\qquad (3)\:.$$
Actually, also the definition of $U$ has to be improved in (3), since it has to encompass the thermodynamic internal energy in addition to all types of macroscopic potential energies.
Referring to standard system of thermodynamics (thermal machines), where $\Delta K$ is negligible and the work done by the external system is identical up to the sign to that done by the system, (3) simplifies to
$$\Delta U = Q -W'\:,$$ 
that is the standard statement of the first principle of thermodynamics for elementary systems. However the general form is (3). 
It is worth stressing that  this picture needs a sharp distinction between macroscopic description (essentially done in terms of continuous body mechanics) and microscopic description, completely disregarded but embodied in the notions of heat and internal (thermodynamic) energy. If, instead one considers also the microscopic (molecular) structure of the physical systems,  the distinction between work and heat is more difficult to understand since both are represented in terms of forces. Nevertheless exploiting the statistical approach to Hamiltonian mechanics the said distinction arises quite naturally.    
Focusing on the system given by a rigid block discussed by BMS, the absolute value of the work $W$ done by the friction force acting to the block due to the ground (that eventually stops the block), is different  from the absolute value of the  work $W'$ done by the block on the ground. The former amounts to $W= -K$ the latter, instead, is $W' = 0$. The energy equation for the block is:
$$W + Q = \Delta U + \Delta K\:.$$
$Q$ is the non-mechanical energy entering the block during the process, responsible for the increase of its temperature. Since $W= -K$ one can simplify that equation to
$$Q= \Delta U\:.$$
The equation for the ground (for instance a table) is instead simply:
$$Q' = \Delta U'$$   
Now $Q' \neq -Q$ and $W'=0 \neq -W$. The fact that $Q+Q' \neq 0$ it is important because it says that there is a heat source between the contact surfaces of the two bodies, and the total heat is not conserved (as conversely was supposed in the original theory of heat, the "flogisto" represented as a fluid verifying a conservation equation).  
If referring to the overall system made of the block and the table, since no energy enters it, the equation is
$$\Delta U + \Delta U' + \Delta K =0\:.$$
That is
$$\Delta U + \Delta U' = -\Delta K >0\:.$$
It says that all the initial kinetic energy is finally transformed into internal energy producing the increase of temperature of both the block and the table.  
A: Here is one issue where thermodynamics and mechanics could differ in the definitions of work.
In mechanics, a non-careful, ambiguous, but common definition for the work done by a force $\vec{F}$ is $\int\vec{F}\cdot d\vec{s}$. The problem with this is that we're not told which infinitesimal displacement $d\vec{s}$ to use; one could use (1) the infinitesimal displacement of the center of mass of the system of interest, or (2) that of the point of application of the force. Thermodynamic work is more consistent with the second choice. Let's look at consequences of both choices in the context of mechanics. Afterward, we'll go back to thermodynamics.


*

*Choosing to use the center of mass can be convenient in mechanics if you want to know how the quantity $\frac{1}{2}Mv_\text{CM}^2$ changes. This is especially convenient if you want to know how the work done by kinetic friction slows a moving mass. For example, consider a block with kinetic energy $K$ that eventually stops due to kinetic friction. After stopping, the relation between work and kinetic energy is $\left|W_\text{fric}^\text{#1}\right|=\mu Nd_\text{CM}=K$. Very handy.

*Choosing to use the point of application of the force allows a better sense of how the total energy of the system changes, not just mechanical energy. Consider again the block with kinetic energy $K$. After the block stops, the change in (macroscopic) kinetic energy of the block is $-K$, and the change in thermal energy is $\Delta E_\text{thermal}>0$ since the block will get warm. Thus, the change in total energy is $-K+\Delta E_\text{thermal}$. Comparing this to the work done in number 1 above, we find
$$\left|W_\text{fric}^\text{#2}\right|=K-\Delta E_\text{thermal}<\left|W_\text{fric}^\text{#1}\right|=K$$
The absolute value of the work calculated using choice 2 is apparently less than one would naively expect using the center of mass displacement. Apparently, the effective displacement of the point of application of the kinetic friction force with choice 2 is smaller than the center of mass displacement. This is actually realistic if one examines the microscopic view of friction, which I won't go into here. The reason I bring this up here is that this second choice has the ability to account for changes in non-mechanical energy.
I mentioned that thermodynamic work is more like choice 2 above. How? Consider a sealed cylindrical container with two moveable pistons on either end. Move both pistons inward. The center of mass of your gas didn't move, yet one would always interpret this as positive work done in thermodynamics. The first choice above says no work is done. The second choice above says both pistons do positive work.
In summary, choice #1 above is fundamentally different than work in thermodynamics. Choice #2, however, is actually consistent with thermodynamic work.
