Hello,
Yes, base64 is safe. HTML2PDF has an explicit code path for "data:" image sources (it base64-decodes them internally before drawing), so this is a perfectly legitimate way around the file path issue.
For context on what you were seeing: the pinkish-gray square is the placeholder HTML2PDF draws when it cannot actually load an image. Our PDF plugin tries to make image loading reliable by detecting img src attributes that point at your site URL and rewriting them to the equivalent local filesystem path (so the library reads the file directly instead of going through HTTP). It also probes each image with getimagesize() and logs an "Image not accessible" warning to the HikaShop log when it fails. But that whole machinery only helps when the underlying file is actually readable by the PHP process; if it is not (file permissions, open_basedir restriction, or anything else that blocks the read) the placeholder is the final result. Base64 sidesteps all of that because the bytes travel inside the HTML itself, no file lookup is needed at PDF time, so it works in environments where direct path access does not.
One bug to fix in your snippet: "$mime = $logoInfo;" assigns the whole array returned by getimagesize instead of the MIME type, which produces "data:Array;base64,..." in the src attribute. You want the "mime" index:
$mime = $logoInfo['mime'];
The rest is fine.