How would I search within an angular distance of an object corresponding to a distance in parsecs? I'm interested in the learning about the local densities around galaxies. I've found myself a bit confused on how to relate angular distances (arcseconds) with physical distances (parsecs) when thinking about distances between two distant galaxies. For example, let's say the average distance between galaxies within clusters is a few megaparsecs. If I had ra, dec coordinates of a particular galaxy and could hypothetically query an all-sky catalog, let's say I'd want to search within a few megaparsecs to get a feel for its density field. But generally when querying catalogs you specify a search radius in some arcseconds. How would these relate here?
Ken G's answer is essentially correct, but there is one important thing to keep in mind: The distance $r$ between the galaxies that is interesting for you is the distance they had at the time they emitted the light you see (you don't care about what has happened to them since that time and how far apart they are today; you care about the physical properties then). But the angle you observe them to span is not angle they spanned when they emitted the light (since they were closer to you in the past, so the light they emitted in your direction at that time would "miss" you by the time it reached that place).

This means that, in your calculation, the distance from you to the galaxies should not be the "physical" distance $d$ (i.e. the actual distance right now to the galaxies, which also corresponds to the comoving distance), but the so-called angular diameter distance, $d_A$. These are related (in a flat universe) by
$$
d_A = \frac{d}{1+z},
$$
where $z$ is the redshift of the galaxies (I assume they have almost the same redshift; if they are too different, then the distance from each other is not simply given by the projected distance). Note that in a non-flat universe, the formula is slightly more complicated; see the link above.

The comoving distance, in turn, is obtained by integration:
$$
d(z) = \frac{c}{H_0} \int_0^z \frac{dz'}{\left( \Omega_\mathrm{M}(1+z)^3 + \Omega_\Lambda \right)^{1/2}},
$$
where $c$ is the speed of light, and $\Omega_\mathrm{M}$, $\Omega_\Lambda$, and $H_0$ are the present matter and dark energy density parameters and Hubble constant, respectively. Here, I've again assumed a flat universe, and neglected radiation since when that was important, there were no galaxies anyway).

Obviously, this effect is not big for small redshifts, but $d_A$ has the interesting property that it increases with physical distance only out to a certain point (roughly $z=1.6$), after which it decreases, because the galaxies were closer to us in the past.

So the physical distance $r$ between two galaxies spanning an angle $\theta$ is
$$
r = \frac{\theta}{d_A}
$$
or
$$
\boxed{
\frac{r}{\mathrm{kpc}} = \frac{\theta / \mathrm{arcsec}}{d / \mathrm{Mpc}} (1+z)
 \, \frac{10^{-3} \times 180\times3600}{\pi},
}
$$
where the last factor accounts for converting Mpc to kpc and radians to arcseconds.

In Python, arbitrarily for $z=2.2$ and $\theta=12.3''$,  it's as easy as

from astropy.cosmology import Planck15
from astropy import units as u
z     = 2.2                               # redshift of galaxies
theta = 12.3 * u.arcsec                   # angle
r_ang = Planck15.kpc_proper_per_arcmin(z) # phys. dist. per angle
r     = r_ang * theta                     # physical distance
print('Distance between galaxies: ', r.to(u.kpc))


which will print Distance between galaxies:  104.22540165050975 kpc.