Edit: I think @gustavodiazjaimes's answer nails it.
given the two scenarios we know (Dalek asylum and victorian London), she doesn't even remember the Doctor
We know at least one other scenario though:
When the first Doctor was about to steal a Tardis, Clara deliberately advised him to steal a different one. Therefore presumably this fragment remembered the Doctor, and the fact that he stole a defective Tardis.
The episode said that when Clara entered the Doctor's time stream, she was split into a million pieces, and scattered throughout his timestream, in order to stop the Great Intelligence from destroying him throughout it.
Thus it's kind of wrong to think of one Clara travelling through his timestream - it's more like lots of fragments of Clara, some presumably with more memory of her purpose and origins than others. (For example, Dalek Asylum Clara was a computer genius. That might be because she was actually a Dalek, or because she retained the computer skills that Original Clara gained in The Bells of Saint John.)
It's possible that for the fragments with less memory, something in the back of her mind encouraged her to pursue and/or help this strange man, despite not being consciously aware of why.
I don't think anything guaranteed that the sacrifice would work:
The Doctor's time stream is his corpse. It's there because he's dead. It’s not situation that's been encountered before. The Doctor told Clara that entering his timestream would kill her, but at the end of the episode she met the Doctor, and remembered what her fragments had done. Presumably her fragments were put back together again, and encountered the Doctor - still, it seems, inside his own corpse - so I think we're somewhat through the looking glass on this one.