OpenGL is a graphics rendering API that can be used to render 2D and 3D graphics. It uses graphics primitives like points, lines, polygons, and textures to render high-quality images. GLUT is a library that provides windowing and input functions to simplify OpenGL program development. An OpenGL program initializes graphics state, registers callback functions for events like display and input, and enters a main loop to process events. Within callbacks, primitives are specified using vertices between glBegin and glEnd commands to render graphics.