I never do fluid mechanics or physics so go easy on me!
I am trying to understand the description of pressure given by Villani in his book Optimal Transport Old and New. This is the discussion right at the start of Chapter 15 Otto Calculus.
We have a (probability) density $\rho$ of some fluid (say over $\mathbb{R}^3$), which has internal energy given by the functional
$$U(\rho):=\int_{\mathbb{R}^3}u(\rho(x))dx,~~~\text{of course}~u:\mathbb{R}\to \mathbb{R}. $$
Then the pressure of the fluid is defined as the rate of change of the energy with respect to the volume, for instance https://physics.stackexchange.com/questions/216342/what-is-pressure-energy#:~:text=The%20pressure%20energy%20is%20the,as%20well%20as%20the%20pressure.
Villani says the pressure is then $$p(\rho):=\rho u'(\rho)-u(\rho).~~~~~~~~~~(1)$$
Call the volume$=V$, here I guess this can loosely be defined as the Lebesgue measure of the space in which fluid is present? Then as Villani says if the density is evenly distributed $\rho=\frac{1}{V}$ then clearly
$$U(\rho)=Vu(\frac{1}{V})$$
and chain rule says $-\frac{d}{dV}U(\rho)=p(\frac{1}{V})=\rho u'(\rho)-u(\rho)$. Ok so defining pressure as $(1)$ works when the density is uniform, but what about if the density is not uniform, we still use this $(1)$ to mean pressure?
Before getting to your question, note that $\rho$ is not probability density. It is just density, i.e., it is a measure of concentration of mass per volume.
Now, in general, $\rho$ can have various values in various locations in the system. Therefore, properties such as pressure ($p$) and internal energy ($u$), which depend on $\rho$, also take different values in different locations in the system. So, to answer your question: yes, equation (1) gives you local pressure.
Also note that the internal energy of the whole system ($U$) is the sum of internal energies of infinitesimal elements that make the system, hence the integral that you mentioned.