From each of the 4 corners, we can draw 5 line segments as described in the problem. Note that we can’t draw a segment from the corner to any of the remaining dots without passing through another dot. From each of the 4 middle edge dots, we can draw 7 such line segments. Note that we can’t draw a segment from this edge dot to the one remaining dot without passing through the middle dot. From the center dot, we can draw 8 such line segments.
From the 4 corner dots, there are 5 line segments each: (4)(5) = 20
From the 4 middle edge dots, there are 7 line segments each: (4)(7) = 28
From the 1 center dot, there are 8 segments: (1)(8) = 8
The sum 20 + 28 + 8 is 56. However, this double counts each of the possible segments. For example, the line between the left top corner and the middle dot was counted among the 5 segments drawn from the left top corner, but it is the same as the segment drawn from the middle dot to the left top corner, which was counted among the 8 drawn from the center.
Thus, the number of unique line segments is 56/2 = 28.
The correct answer is D.
While I like this explanation, it seems to involve a dangerous risk: how do you know you're double-counting everything?