Sometimes yes and sometimes no. Dialogue recorded in the studio is referred to as ADR (additional dialogue recording).
A scene shot on the beach (for example) would have the dialogue re-recorded in a studio. However the character's dialogue would still be recorded on set and used as a guide track.
A scene shot in a motel room (for example) would most likely have the audio recorded on-set and used in the final cut as it is much easier to control sound in such an environment.
Contrary to what Colum has said, it is not impossible to sync the audio and actor's lips in post production -- there are many techniques to achieve such a goal. Although, Colum, is correct in saying editors have many different takes to cut in between.
A cool trick to see if the audio and visual of a particular shot were recorded separately is to look at the other person's face in a two shot (where both characters have lines) and see if their lips are out of sync with the audio. By 'other person's face' I mean the character who is not the focus of the shot. It is common in a conversation scene between two people that you cut to one character's reaction before the other has finished speaking. If the shot is framed as such that you can see the other character's face, you will notice that their mouth is moving but it's out of sync with the audio. Not many people notice it because they are looking at the focused subject.