For bees at least (TLDR version): it varies.
How far they will follow you depends on the individual bees, bees from some colonies will chase you down the road, some will give up once you’re just a few meters away. It does appear to be largely genetic, so many beekeepers will avoid breeding from those colonies prone to chasing.
Their level of aggressiveness also increases during the age of the bee (which makes sense, if you think about it; they die if they sting you, so older bees are more likely to do so than younger bees which are more valuable to the hive), so some bees which are near to death anyway will be very determined, I always think they want to go out with a blaze of glory. A lot of the bees in the hive will be recently hatched, and they won’t sting at all, regardless of what you do to them.
It also depends on the season, they’re more prone to chasing when there’s not much nectar around. If you’re lucky enough to disturb a hive that’s busy bringing in loads of nectar right now, they may just ignore you altogether. As a beekeeper, if I pick the timing right (sunny summer day, lots of nectar around) I could take the hive to bits and take honey out without getting a single bee acting aggressively. I always do wear a bee suit, but I have met old beekeepers who reckon they can read the hive well enough to go in without.
Other times, especially in autumn, when the bees are guarding against wasps which rob the stores, they start acting defensively when I’m still a few meters away. August is angry month round here, as the main nectar flow finishes but there are still lots of bees around that have been bringing in the main summer crop, then the mass of summer workers gradually die off, and come September the colony’s shrunk, and they’re all very calm again.
You can tell if they’re aggressive from the pitch they buzz at, higher pitch means they’re getting wound up, sometimes they also ‘bump’ against you before trying to sting. Jerky movements attract aggro, as do dark colours.
One of the handy tips I’ve learned is, if you’re being chased, they will rarely go under or into things- so going into a shed or a car, or even under an archway will often be enough to stop them following you.
They do release a pheromone when they sting, which attracts other bees, but the effects seem to wear off very fast. Occasionally when in my hive I’ll accidentally squish one, which releases the pheromone, and a cluster will form round the body for a few seconds, buzzing angrily, but after 20 seconds or so, they disperse it’s back to normal. Sometimes I’ve been stung and none of the others have paid any attention, it’ll trigger a guard bee to attack, but not one engaged in another activity. If there’s a lot of the pheromone, it’ll last longer, but a couple of stings won’t trigger a mass attack.
Africanised bees are apparently way more chasy and aggressive, but they’re thankfully not a thing over here.
Wasp aggro also increases through the year, but I’m not quite stupid enough to keep wasps.