If you would like to have a Horizontal Line in Google Doc Header and/or Footer, use the following steps:
1. Select Insert –> Headers & Footers –> Header.

2. Select Insert –> Horizontal Line.

Please do the same steps for Footer after doing it for the Header if you want to have the horizontal line in the Footer also.