This conversion from Dollar('$') to ('#') is occuring from the below code snippet inside Sitecore.DevEx.Serialization.Client.dll, which converts all the invalid file characters to '#' symbol.
I believe the changes were made to address and convert all the invalid characters to '#' using above code snippet.
Inside version 4.2.1 of Sitecore.DevEx.Serialization.Client dll, invalid file characters were replaced with underscore('_') symbol.
Below is the list of characters that are considered to be avoided in filenames.
https://www.mtu.edu/umc/services/websites/writing/characters-avoid/
Hope this helps!!!