How familiar are you with index notation? That's the easiest way to show this. Generally speaking, for a Newtonian fluid, the constitutive equation describing the stress is
\tau_{ij} = -p\delta_{ij} + \mu\left( \dfrac{\partial u_i}{\partial x_j} + \dfrac{\partial u_j}{\partial x_i} \right) + \delta_{ij}\lambda\nabla \cdot \vec{v}.
If you take all of the normal stresses and sum them and divide by 3 (in other words, if you average all of the normal stresses) then you can define what is sometimes called the mechanical pressure
\bar{p} = -\dfrac{1}{3}\left( \tau_{xx} + \tau_{yy} + \tau_{zz} \right) = -\dfrac{1}{3}\mathrm{tr}(\tau_{ij}).
This makes sense to do because ##\mathrm{tr}(\tau_{ij})## is a tensor invariant and so is independent of rotations (the choice of coordinate systems). The end result is that you get
\bar{p} = p - \left(\lambda + \dfrac{2}{3}\mu\right)\nabla\cdot\vec{v}.
So, in the most general sense, no, the mechanical pressure (the actual isotropic normal stress in a moving fluid) is not equal to the thermodynamic pressure, ##p##. Further, the second coefficient of viscosity (##\lambda##) is a very nebulous property that is not all that well-understood, even after over a century of viscous flow research. The primary reason for that is that it just isn't generally very important in practice. Consider the following two situations:
- Stokes' hypothesis: ##\lambda + \frac{2}{3}\mu = 0##
Stokes made this assumption some 170 or so years ago and it is still commonly made today, and in most cases, it works well. It hasn't really been proven or even supported all that strongly in any experiment, which is why it is still called a hypothesis, but practical calculations made using that assumption seem to match reality an overwhelming majority of the time. The only major hole in it that I know of is attenuated while propagating through a fluid. In that case, this hypothesis does not work, but most other cases it is sufficient.
- Incompressible flow: ##\nabla\cdot\vec{v} = 0##
Obviously in this case the term containing ##\lambda## is zero and ##\bar{p} = p##. This is effectively true in any liquid and any incompressible gas flow. Nothing is every perfectly incompressible, so it's still just an approximation, but decades of experimental results have by and large borne this out that ##\bar{p} = p##. In flows that are compressible, ##\nabla\cdot\vec{v} \neq 0## and the bulk viscosity can be important sometimes, but in the overwhelming majority of cases, the viscous normal stresses are effectively zero and ##\bar{p}=p## still holds. The primary exception is in shocks, in which case ##\bar{p}\neq p##.
Anyway, the short answer, in case all of that was a bit beyond your familiarity level with fluid mechanics, is that the ##\nabla\cdot\vec{v}## is almost always negligibly small, whether due to incompressiblity or luck that Stoke's hypothesis holds. In the rare cases where it does have considerable magnitude, then you are correct that the actual mechanical pressure, ##\bar{p}##, cannot be treated as being equal to ##p##.
There is a bit more discussion in
https://www.amazon.com/dp/0072402318/?tag=pfamazon01-20 and some more in both
https://www.amazon.com/dp/0750627670/?tag=pfamazon01-20 and in
https://www.amazon.com/dp/1118013433/?tag=pfamazon01-20.