Is it correct to use the pinhole camera model to get the mapping of a 3D line to a line in an image?
The assumption is correct, if(f) you project the 3d line into the rectified image. The idea of projecting a 3d-line to a pixel-line is most often used in a stereo setup with two cameras: if the left camera sees a features at a certain pixel, then you know that this object is on a 3d-ray that corresponds to this pixel. If you want to search this object in the right camera's image, you only have to search on the pixel line that corresponds to this 3d-line. 
Keywords are here epipolar geometry or epipolar line: 
https://www.robots.ox.ac.uk/~vgg/hzbook/hzbook1/HZepipolar.pdf