Is the word "shag" used in the same way in the following two sentences?

The dog's woolly shag.

He bought a shag rug.
different meanings