Using 2D approximation of a problem, you're often implicitly assuming that the $3^{rd}$ direction you're neglecting is a homogeneous direction, i.e. the domain of the PDEs has a symmetry (translation symmetry, if you're using Cartesian coordinates, neglecting one of them, the 'out-of-plane' direction - let's call it $z$) and the solution doesn't depend on that coordinate as well.
Navier-Stokes in 2D. Namely, if you have a $z$ homogeneous direction, the velocity field is
$\mathbf{u}(\mathbf{r}) = u_x(x,y) \mathbf{\hat{x}} + u_y(x,y) \mathbf{\hat{y}} $.
You can evaluate a flux per unit-length, and a retrieve the flux exploiting the homogeneity of the $z$ coordinate.
As an example, if you're representing the flow between two large parallel flat plates, normal to the direction $y$, separated by a thin gap (so that the Reynolds number is low enough to avoid instabilities), the velocity field is approximately
$\mathbf{u}(\mathbf{r}) = 4 U \dfrac{y}{H}\left(1-\dfrac{y}{H} \right) \mathbf{\hat{x}}$,
being $U$ the maximum magnitude of the velocity field, $y=0$ and $y=H$ the coordinates of the flat plates, $x$ the direction of the flow, and $z$ the 'out-of-plane' homogeneous direction.
You can easily evaluate the mass flow per unit "depth" across a section of the channel with the integral
$\displaystyle \dot{m}_{2D} = \int_{y=0}^{H} \rho u_x(y) dy = \dfrac{2}{3} \rho U H = \rho U_{avg} H$, $\qquad $ with $\qquad[m_{2D}] = \frac{kg}{s \ m}$
being $U_{avg} = \frac{2}{3}U$ the average velocity of the profile.
If you need to evaluate the flux across a rectangular surface orthogonal to the velocity whose $z$-side has length $B$, you'd need to perform the integral
$\displaystyle \dot{m} = \int_{z=0}^B \int_{y=0}^{H} \rho u_x(y) dy$,
resulting in
$\displaystyle \dot{m} = \rho U_{avg} H B $, $\qquad $ with $\qquad[m] = \frac{kg}{s}$,
since the problem doesn't depend on $z$.
Heat flux in 2D. The same occurs if you consider a 2D heat conduction problem. The flux across a (one-dimensional) section of the boundary of the domain is a flux per unit length, and has the dimension of $\frac{W}{m}$.