As Bromden is looking out the window he is reflecting on his place in society. He has been hiding in the fog, but because of McMurphy, he is beginning to come out of it.
Bromden is reflecting on the wild and natural world. The geese catch his eye because they are wild and free. Perhaps subconsciously, they remind him of McMurphy; both are able to rise above society and "fly free". Comparatively, the dog is a domesticated animal, and more closely represents most men on the ward. They are in the ward to be tamed/domesticated so that they may fit into society.
As the dog sniffs around, Bromden notices a car speeding down the road. Eventually, the dog goes too far, and the implication is that he is killed by the car. Through this example, and other machine imagery in the book, Kesey is suggesting that anyone who gets in the way of the "machine" (society) will be taken out, just like the dog. The only way to escape it is to find someway to fly free, like the geese and McMurphy, which he is still figuring out.
To add to the excellent reading provided in the previous post here, we can take a look at how this passage functions as a rather pointed metaphor for the action of the novel, foreshadowing McMurphy's fate. We can also note some motifs at work in the passage that lend meaning to the episode where Bromden looks out the window and watches the dog.
First, the dog's behavior is entirely natural and uninhibited. These are the traits that McMurphy brings to the ward. Frolicking by itself and willing to indulge its innate energies, the dog is a very good analogy for McMurphy, who likewise has taken a risk in opting for the mental ward and has metaphorically "slipped off from home to find out about things went on after dark."
The dog pursues its own ends, regardless of the world around it, investigating gopher holes and drunk with the wild freedom of the night. But its own interests collide with that of another world, one that is mechanized, socialized and ordered by rules. A distinct implication is offered in the line, "I watched the dog and the car making for the same spot of pavement." The natural animal may not survive its encounter with the mechanized world which is conformist and highly regulated.
"In the microcosm of the psychiatric ward, control is the objective — an ominous control that supplants freedom with regulations, favors monotonous routine over spontaneity, and rewards assertions of personal opinion with visits to the 'Shock Shop'" (eNotes).
Similarly, McMurphy collides with powers that prove insurmountable in the ward. These powers, personified by Nurse Ratched, have previously been compared to that of the automobile.
"She starts moving, and I get back against the wall, and when she rumbles past she's already as big as a truck, trailing that wicker bag behind in her exhaust like a semi behind a Jimmy Diesel. Her lips are parted, and her smile's going out before her life a radiator grill."
Ratched is thoroughly associated also with the Combine and is depicted as an agent of the social machine that Bromden fears and struggles against.
The same system was faced down once by Bromden's father, who finds a way to laugh off some government men who attempt to persuade the chief into accepting an offer. Bromden recalls that his father made the men look ridiculous by pointing out geese in the sky. There were no geese in the sky, but the chief suggests that the men simply cannot see what is there.
In doing this, the chief inverts the power dynamic, making fools out of the men who have come to treat him like a fool. The geese then are a symbol of resistance and also a symbol of the power of individuals to insist on their own integrity and solvency, refusing to accept an imposed point of view.
When Bromden opens his eyes to the scene in the night with the dog sniffing gopher holes, the geese flying overhead and the approaching car, his vision is informed by these motifs. The joy and innate energies of those who stand against the Combine are represented by figures of the natural world. The constraints and threat of the Combine are represented by the car that will run down the dog.
The episode foreshadows McMurphy's fate in the ward, but also shows that Bromden is connecting a sense of his own history to the resistance to the system posed by McMurphy. The fact that he has opened his eyes adds to the sense that Bromden is beginning to achieve some agency of his own.