Why are "sundogs" called by that name?
Before answering the why question, let me answer the what question that comes before: namely, what is a sundog, or mock Sun, in the first place?
A sundog is a concentrated patch of sunlight occasionally seen about 22° to the left or right of the Sun. Sundogs often form in pairs on either side of our daytime star when sunlight refracts through icy clouds containing hexagonal platecrystals aligned with their large, flat faces parallel to the ground. Technically known as parhelia (singular parhelion) they are often white but sometimes quite colorful, looking like detached pieces of rainbow, with red on the inside, toward the Sun, and blue on the outside.
A Sun halo, a circle of light that creates a circle 22° wide around the Sun, is a related phenomenon. As with sundogs, hexagonal ice crystals suspended in cirrostratus clouds refract sunlight to create the halo, sometimes also called an icebow, nimbus, or gloriole. Unlike sundogs, which generally only be seen when the Sun is near the horizon, the halo is visible even when the Sun is high. Sundogs appear along the 22° halo and disappear as the Sun rises.
As to the why: There are several authoritative books and websites about atmospheric phenomena, but none of the ones I checked say anything about why parhelia are called sundogs. My guess is their authors are cat people. I’m a dog person, and whenever I’m at home, my pooch, Duncan, follows me around the house close at my heels — just as a parhelion dogs the Sun. While I can’t prove it, I’d wager the term “sundog” was coined by an observer with a dog. The term has been in use since the early 1600s, so we’ll probably never know its origin for certain.