No, they don't. That's why you teach them. And if you want to tell your dog that bending his knees and putting his butt on the ground is called "lollipop" go ahead. However, a 3 year old kid might not know what "sit" means either. Their first exposure to meaning is probably via connecting the word to the behavior. I.E. putting her butt in a chair or on the floor.
Sounds like what we have to do for dogs, no?
The difference is that we humans "agreed" (or more likely, have been conditioned to accept) that the word "sit" means to put one's butt in a chair or one floor while the upper body is still upright (otherwise, we'd be lying down and not sitting). That's probably the main reason telling that 3 year old girl that she's "lollipopping" very nicely would make no sense.
Dogs just don't come with that preconditioning for human speech, and can't learn it, per se.
So what does this have to do with Wally? Well, I saw on a forum I visit where a dog followed the behaviors in a sentence exactly in order. This is the post in question. It made me think - while the dog doesn't understand all those words have a meaning in themselves and that it's a sentence and all of that, the dog has a concept that those words make up individual cues, objects, and locations that were all strung together. That in and of itself is impressive, forget all the "it's not like a human" stuff.
So I was wondering - is there a way I could achieve something like this for Wally and how to go about it? Could it be possible even to teach him a "language structure" in that expressions will formatted a certain way (it's own grammar) with "nouns" and "verbs" and "objects" and "locations". It would be similar to how programming languages work for computers. A computer doesn't understand those words have meaning in the human sense, but they have their own "meanings" within the construct of C++ or Visual Basic or whatever. The language has "grammar" (syntax as it's called), and give instructions in basically one big "behavior chain".
We may have the foundations of this. Wally knows that "go <whatever>" would mean to go and do <whatever>. I always use "go" with movement cues. "Go potty", "Go get it", "Go around", etc. Perhaps this can help him "understand" what "Go" means. If I say "Go" but that's it - he's waiting for the rest. Maybe "go" has been generalized as they say, and the concept learned.
Maybe the hardest part, other than trying to come up with a 'language' from scratch, is teaching him names of stuff, like his toys, or colors, or the possible locations. In other words, the "verbs" might be the easy part. It's the "nouns" and "prepositions" that might be the hardest part.
Anyway, it's something I've had in my head for a while, and maybe it's a project to work on. At least I know it's possible. Look at Rico the Border Collie, or Chaser who knows 1022 words.