There seems to be a correlation between Carlson's shooting Candy's old dog and George shooting Lennie. Steinbeck planned to have George kill Lennie--but he had to have a gun. The episode with Carlson shooting the dog serves a dual purpose. It establishes that Carlson owns a gun, a Luger pistol. Steinbeck devotes a whole paragraph and some additional exposition to describing what Carlson does with it after shooting the dog and returning to the bunkhouse. Finally:
Carlson finished the cleaning of the gun and put it in the bag and pushed the bag under his bunk.
This is what in Hollywood parlance is called a "plant." It establishes that there is a gun available and that George knows exactly where it is. He has also seen Carlson working the mechanism of this foreign handgun, so he will understand how to inject a cartridge into the chamber. George, of course, does not plan to shoot Lennie at that time, but he will remember that Luger when he makes the decision to kill his friend.
The whole description of Carlson's Luger can be considered foreshadowing. The reader senses that the gun will appear again somewhere in the story.