The headsets are active between plays, and have one way communication with one player on each side. Typically this is the quarterback on offense and a team captain/play caller on defense. These players wear special helmets typically marked with a green dot on the back.
The refs or other officials cut off communication when the play clock reaches 15 seconds, preventing the kind of real-time communication you suggest.