where does openGL draw to

when we draw a line on the screen where exactly does openGl draw these pixels to … can we make it draw to some buffer of our choice

Yes. Take a look at FBOs.

http://www.opengl.org/wiki/GL_EXT_framebuffer_object