You spend it after the roll.
The timing in that other question's answer is how it is because, there, you are making the roll with Advantage, and, it reasons, you can't properly roll with Advantage unless you roll the two dice simultaneously.
There is no similar need to roll simultaneously here, as this use of Luck doesn't involve Advantage and only superficially resembles that other question about using Inspiration. So, that precedent discarded as unrelated, that leaves us with just the text involved.
Rolling simultaneously with someone else requires coordinating with them, and is unusual enough in RPGs (and unheard of in D&D) that if you had to do that for some reason, it would be called out in the text. So we can discard simultaneity. (That doesn't rule out having to decide before the other attack roll is revealed, but I'll get to that in a minute.)
The trigger is "when an attack roll is made against you." This is after the roll has been made. If the decision had to be made before the roll was made, it would say so either by saying that you have to decide before you know the roll result, or by giving a trigger that happens earlier like "when you are attacked." It does neither, so the ability, and decision, is triggered after the die roll is made.
But maybe the decision is after the die roll, but before you know the result? This is possible, especially if your DM is making NPC/monster die rolls behind a screen. But, that's not the arrangement 5e assumes—it would not be taken as given, as the default, in how the rules are written. But even in the case of hidden rolls, the default would be that you decide after the roll is revealed—you can't react to a roll you don't even know is about your character! Since the trigger requires the attack roll be made against you, and it's not "when you are attacked", you don't need to decide when a rolling-in-secret DM merely says you're being attacked: you get to wait for the attack roll to be resolved, including what its result is—regardless of whether this result is the number rolled or just being informed that "it hits." Barring house rules around hidden DM dice rules, of course—this could be different at your table, so I want to stress that I'm only looking at what the rules appear to assume is the default, sans house rules.
This is an overly-complicated way to say: "You roll it after the attack, because the trigger is an attack roll having been made—past tense."
The answer really is that simple though and could have been written that simply. It's only longer because it takes effort to untangle it from that other question's unrelated issue first, and then once you're beating an idea with a language and logic analysis, the rest falls flat if it's not done with a similar degree of rigour. But that's the real answer, unencumbered by entanglements: you choose after, because the trigger says so.
I think this is pretty cut and dried with just what you have quoted. If you're a Luck Halfling and you roll a 1, you can re-roll it once and use the number. Then if you just don't like any number you rolled, even the re-roll, you can spend a luck point to re-roll (again). One doesn't replace the other, you simply have both features, and both operate exactly as they written.
First Case: Feature then Feat
So if you use Halfling Luck to reroll a 1, can you then decide to use a luck point and still get to choose any of the dice?
Yes.
Example
Let's say you roll to attack, and roll a natural 1. Your halfling luck kicks in:
When you roll a 1 on an attack roll, ability check, or saving throw, you can reroll the die and must use the new roll. (PHB, 28)
You get a, say 5. It still isn't high, so you choose to use your luck feat.
Whenever you make an attack roll, an ability check, or a saving throw, you can spend one luck point to roll an additional d20... You choose which of the d20s is used for the attack roll, ability check, or saving throw. (PHB, 167)
Second Case: Feat then Feature
Or if you use a luck point and that dice rolls a 1, do you reroll it with Halfling Luck and then still get to choose any?
Not quite. The roll is whichever you choose when you use in the feat Lucky. So, you could choose the 1, and then get to re-roll, as per RAW, but you'd have to use the number of that Halfling luck reroll not the previous two.
Example
So, in this case you roll a 3 and use Luck Feat to roll again, you roll a 1.
Whenever you make an attack roll, an ability check, or a saving throw, you can spend one luck point to roll an additional d20... You choose which of the d20s is used for the attack roll, ability check, or saving throw. (PHB, 167)
You choose the 1, specifically to trigger your halfling ability. So, you've now effectively rolled a 1, and get to reroll it:
When you roll a 1 on an attack roll, ability check, or saving throw, you can reroll the die and must use the new roll. (PHB, 28)
Best Answer
The modifier is added to whichever die roll you choose
The roll is the result of the dice; the +6 is the modifier. That is added to either roll result.
This means you may choose from either 23 (die roll of 17 + the modifier of 6) or 21 (the roll of 15 + 6).