Dollar sign in mdfind shell command
A dollar sign before a single-quoted string is just another type of string, but it allows C-like escape characters, like \n and \'. 

It was used in the command you mentioned because it contains an escape for the single quote—normal single quoted strings do not allow any escapes at all, including escapes of the '. Backslashes are interpreted literally. So by using $'…' it avoided escaping the double quotes, and allowed the string to have a ' in it. 

There is some more information on this type of string quoting here on the Bash Hackers Wiki.