For the pressure drop in a cylindrical pipe we can use $$dQ=2 \pi rdr$$ to arrive at the Hagen-Poiseuille equation $$Q= \frac{\pi R^4}{8 \mu} \left( - \frac{dp}{dx} \right)$$ but I have also found $$Q=\frac{\pi d^2}{4} U$$ in literature. Why there are two different formulas for volumetric flow rate $Q$?
2 Answers
Your first equation should read $$dQ=2\pi r v(r) dr$$where $$v(r)=2U\left[1-\left(\frac{r}{R}\right)^2\right]$$and where U is the average velocity. This leads to your third equation $$Q=\pi R^2U=\pi\frac{d^2}{4}U$$The Hagen-Poiseulle equation gives the average velocity as a function of the pressure gradient: $$U=\frac{R^2}{8\mu \left(-\frac{dp}{dz}\right)}$$These lead to your second equation.
The Hagen-Poiseuille equation
$$ -\frac{d p}{dx} = \frac{8 \mu Q}{\pi R^4}$$
can be derived analytically assuming laminar steady-state flow of an incompressible and Newtonian fluid in a pipe of constant cross-section. As axisymmetry and steady-state are assumed in the derivation, the description fails for low viscosities $\mu$ ("low damping") and large radii $R$ as the pipe flow might turn turbulent for
$$ Re_D \geq Re_D^{crit} \approx 4000 $$
with the Reynolds number in terms of the tube diameter $D = 2 R$
$$Re_D := \frac{U D}{\nu} = \frac{\rho U D}{\mu}.$$
It allows you to determine the pressure drop from the volumetric flow rate or vice versa for any flow that fulfills the previously mentioned assumptions. For any flows that do not fulfill these requirements you might find empirical correlations (approximations) such as the empirical Darcy-Weisbach equation that might account for turbulent pipe flow (again with constant cross-section) or the Ergun equation for flows in porous media.
The formula
$$Q = \frac{\pi D^2}{4} U$$
on the other hand holds for any one-dimensional incompressible flow
$$Q = \frac{dV}{dt} = \frac{d (A x)}{dt} = A \underbrace{\frac{dx}{dt}}_U = A U.$$
In particular for a pipe flow you get $A = \frac{\pi D^2}{4}$. It is a basic manifestation of the one-dimensional incompessible continuity
$$ \dot m = \frac{dm}{dt} = \frac{d (\rho V)}{dt} = \frac{d \rho}{dt} V + \rho \frac{d V}{dt}$$
for constant density $\frac{d \rho}{dt} = 0$. For your formula you basically assume a constant velocity across the entire cross-section but this approach may also be extended to a cross-section with an arbitrary velocity profile by averaging over the cross-section.
Summing up: Both are formulas allow you to determine the approximate volumetric flow rate (with several limitations) from the pressure drop or the velocity profile. As see you can see two different formulas with different parameters, different assumptions and thus different limitations.