If you use L"..." to make a LaTeX string, then you can’t use $ interpolation in the strings. (Technically, $ interpolation doesn’t occur in Julia string macros.) This is intentional, because $ has its own meaning in LaTeX.
To do interpolation, just use an ordinary Julia string. This means you have to escape characters like $ and \ if you want to use them for LaTeX.
legend((h1, h2), ("\$\\sin( $m x)\$", "Linear"))
(Note also that you wouldn’t want to use L"Linear" for a text label like Linear, because L"..." implicitly puts the contents into an equation.)