The first verse ( Luke 9:51) sets the agenda for all that follows until Jesus" Triumphal Entry. It was now time for Jesus to begin moving toward Jerusalem and the Cross. As He did Song of Solomon , He immediately encountered opposition (cf. Acts 20:3; Acts 21:4; Acts 21:11-14), but He accepted it and refused to retaliate against His opponents. Jesus" attitude here recalls His reaction to the opposition He encountered in Nazareth at the beginning of His Galilean ministry ( Luke 4:16-30), and it previews His attitude in His passion. It also contrasts with the disciples" attitude toward others and provides a positive example for reader disciples who sometimes encounter antagonists who are similar to the Samaritans. [source][source][source]
It is difficult to make this incident fit into its Lukan context chronologically. Probably our writer was not following a strict sequence of events here but inserted this incident where he did for thematic purposes. [source][source][source]