SWTOR Group Conversations and Companion Affection
If you do not win the conversation roll, then since you didn't say it, the companion does not get any affection points.
You have to both choose the appropriate option to gain (or lose) affection with the current companion, and win the roll.
Of course your companion must be summoned and in the group, so this only works for groups less than 4.
It is not like Light/Dark side choices where you get the points for what you chose regardless of who won the roll.