Naturally, when I brought up hauling away treasure, the idea of thieves stealing it came up.I tend to think this is a bit iffy, if only because in my experiences players worry about it. This means they hold back some reserves for the trip home, and take extreme precautions in self-protection. It's not unusual in my games for PCs to use a defence-in-depth mix of magic, guards with night vision, traps, noisemakers, caltrops, etc. to secure their camps. And yes, they sleep in their armor with hands on their swords. Discomfort beats death.
Nevermind adventurers being both prone to violence, possessed of unusual resources, and extremely enamoured of revenge. Which means even if you do pull off a heist, expect them to remember this forever, and to be willing to expend resources - even well in excess of what you took - in order to get back at you for it. Like the mafia, they generally care more about you being perceived as getting away with it more than they care about the loss itself.
But you can still try. If you do, where to go for it?
Worst Place: The Dungeon. In the dungeon, wilderness, or other danger area. Much like the worst place to try to sneak up on someone is when they are at maximum alertness, the worst place to try to rob adventurers is in the dungeon.
Not only are PCs at their maximum alertness in the dungeon, but generally we're talking about people who are making it their profession to kill things for their possessions or for the treasures they guard. They're ready to deal death and expect to have zero consequences for doing so - and even if they are wrong, you are still dead. Robbing adventurers in a dungeon is like mugging a cop in a police station or conducting a stickup at the firing range. Ballsy, but stupid.
Sneak thieves might grab something, but it's hard to sneak in a dungeon without supernatural powers . . . and there are better places to use those powers.
Second Worst Place: The Trip To The Dungeon. They're not likely to have any loot yet, besides their gear. They're loaded up for battle and not only are keeping an eye out for trouble but are actively seeking trouble out. You have the least to gain, and the PCs are at their best. Bad idea. It's only better than in the actual dungeon because it's going to be slightly easier to sneak, and they might be worried about distraction from the real loot to chase after you . . . at the moment.
Third Worst Place: The Trip Home: This is better than the previous two because it's not uncommon for adventurers to be dragging themselves home half-broken. They'll (hopefully) have been successful, and hopefully have won their loot in a Pyrrhic fashion and be unable to fully guard it.
Again, though, these are professional killers with a tendency to settle things both putting Xs across your eyes and turning your remains into loot-carrying zombie laborers. Expect that they have some resources you don't. You are taking the least risk of the "wilderness" area robberies, here, although if the lands are even semi-civilized you're probably running afoul of the law, too.
You have to be careful of the fake-out, too - adventurers in good condition in bandit-infested areas tend to see bandits as mobile loot carriers, and thieves as a good source of petty cash. Just because they look hurt doesn't mean they are hurt. Even Gary Gygax did this (as recounted in Dragon, Sept. 2002), purposing seeking out bandits for their treasure.
Best Place/Least Bad Place: In Town: In town, the adventurers will partly let their guard down. They will be the most restricted in their retaliation, too. They still might stick you with a sword, but it's less likely. It's easier to pull a sneaky purse cutting than to stab one and grab his stuff, as well, putting the emphasis on your sneakiness vs. their watchfulness instead of your sneakiness or skill at arms vs. theirs. It's the best place, although the reward is the lowest - only what you can stealthily take away.
Honestly (pun intended) the best approach isn't to steal money, but to offer goods and services to the adventurers. They're loaded and generally want something in return. They tend to bargain less hard when they're loaded and you have something interesting and unique to offer. Adventurers lose more money to merchants willingly than to all thieves everywhere for all time. Sell them stuff. And if they're coming home staggering under the weight of their money, you can absolutely ensure a piece of it by offering to help carry it . . .
Now, a lot of the above assumes somewhat skilled PCs and not-as-skilled thieves. If your (game) world assumes 1st level PCs and 15th level thieves with a parcel of allies along, yes, you can rob them anywhere. But it's a wonder how you got to high level robbing violent killers instead of folks unwilling to pay the cost of retaliation. Being a successful thief, like being a successful adventurer, means looking for loot where once you get it the primary danger is already over (dragon is dead, orcs are slain, etc.) and not the beginning of your problems. Adventurers forgive being beaten, but not being robbed, and they have a reputation to protect. Bandits and thieves - the successful ones - might want to keep in mind who they want to rob, and where, or they'll likely end up as just one more encounter.
* By "dungeon" I mean, broadly, any place your typical fantasy adventure game delvers are exploring for treasure or to accomplish some goal. It doesn't literally have to be a dungeon, just a place of danger where active adventuring is going on.