There's a package by Spatie, pixelmatch-php, that compares the similarity between images. But the accuracy might not be perfect since it's simply comparing pixels.
For a "smarter" and more accurate solution, I believe the OpenAI (ChatGPT) API allows you to upload images. There are also other computer-vision APIs, but there's obviously the cost factor.
If the logo contains text, OCR could work.
But if you just want to associate products with a certain brand and display the logo on the page, it would be much easier to add a dropdown with all possible brands or the option to add a new one.