The sages prohibited a man to be secluded with a woman alone inside a room with a locked door.
Does the prohibition of yichud apply in a car that is locked?
Mi Yodeya is a question and answer site for those who base their lives on Jewish law and tradition and anyone interested in learning more. It only takes a minute to sign up.Sign up to join this community
According to Rabbi Feinstein in the Igros Moshe chelek Even HaEzer 4 siman 65 #3 it is an argument between the Chelkas Mechokek and the Beis Shmuel if yichud is an issue in a car. The source of contention is whether being in a situation of non-yichud which can very easily lead into yichud is assur to put ones self in. He said to be machmir exept when it is really necessary, like the chillul Hashem of telling a lady you can't give her a ride.
See also Igros Moshe Yo'D. 2 siman 82 concerning a lady taking a taxi to the mikva which touches on this point as well.
It seems to apply to cars even when not locked.
R. Yitzchak Abadi has a responsum (Ohr Yitzchak vol. II Inyanim Shonim #13) in which he critiques the responsum of R. Feinstein cited in user6591's answer, and specifically the idea that we are concerned that they might move themselves from a situation of non-seclusion into a situation of seclusion:
דברים אלו תמוהים דלאונס לא חיישינן ביחוד וכל זמן שהם בדרך הרבים שלא שייך שם שיבעלנה אין פה איסור יחוד ולחוש שמא ישנה דרכו וילך לדרך צדדית לזה ודאי לא חיישינן דהא בפתח פתוח לרה"ר מותר להתייחד ולא חיישינן שינעלו את הדלתות וא"כ כל זמן שהם אינם במצב של יחוד אין כאן איסור ואין כאן שום ספק אלא שהאגרות משה מתיר שם רק בשעת הדחק וכנ"ל ואין צורך לזה
These words are astounding, for we are not concerned about force when it comes to seclusion, and as long as they are on the public road – where it is not feasible for him to copulate with her – there is no prohibition of seclusion. And to be concerned that he might deviate his path and go to a side road is certainly not a concern, for [in a case] where the door is open to the public thoroughfare it is permissible to seclude and we are not concerned that they will lock the doors. If so, then as long as they are not in a situation of seclusion [even though they can easily create a situation of seclusion] there is no prohibition, And there is no doubt here at all; rather, the Igrot Moshe only allowed it there in a pressing circumstance, as mentioned earlier, and there is no need for this.