Strangely enough, these issues happen with more sophisticated printing sources like MS Office or Acrobat, but not with Notepad. But I seem to have found a workaround, and it's a bit non-trivial. From MS Office, I print to PDF using CutePDF printer driver (default Microsoft's Print To PDF doesn't write any PDF contents and just creates a 0-bytes-long file). Next, I load the PDF, created by CutePDF, in Firefox 52. And from there, printing works like a charm.
Conclusion - I won't buy any PDF printers in the future. I don't have this problem with Canon or Epson printers on the same computer and the same VMs.