In normal usage the timing won’t matter that much, just as long as the roll happens before doing the action you want to repeat.
That line in the PC about doing it immediately before the action is mostly for bookkeeping/clarity purposes so there’s no confusion about what the roll is being used for, but it also prevents (or at least reduces) any attempts to fudge the rules by generating the action but then removing the crew from the ship before actually taking it. I can’t recall specifics, but I think at one point someone found a weird loophole that line closed.
That treasure-grabbing ability isn’t triggered as part of the explore action, so you have to complete the entire action before you can use it.
What you could do is have a non-canoe ship explore to load up with treasure, then have the canoes nearby grab one each from there and move away with their own actions.