Should I fertilize shrubs before or after rain?

Depends on whether the ground is wet before it rains

That depends on whether the ground is wet before it rains. Fertilizer should never be applied to dry ground or dry plants. Chemical fertilizers can burn plants when the ground is dry, because the salts that are a by-product of the fertilizer will reach the plant cells before the water can replenish them.

Most organic plant foods need moist soil to break down and allow the beneficial microbes in them to proliferate. If the ground is already moist and you know a measurable amount of rain (at least 1/2″) is coming, then apply your fertilizer before. If the ground is dry, allow the rain to replenish the soil with moisture and then apply your fertilizer. After you fertilize, make sure to water the fertilizer in so it percolates into the soil.