Compare and contrast:
https://d337mqk8vr3mvq.cloudfront.net/uploads/media/logo_retailer/0001/06/thumb_5984_logo_retailer_1x.png
&
https://vignette.wikia.nocookie.net/logopedia/images/1/15/Apple-logo.jpg/revision/latest?cb=20170702160841
Logos can be registered as trade marks
https://www.gov.uk/how-to-register-a-trade-mark/what-you-can-and-cant-register
but if someone hasn't already registered a logo as a trade mark then anyone else is free to use it (unless they're deliberately 'passing off' their own product or service as being one from the other user of the mark).
Perhaps whichever of the two companies used the logo first never bothered to register it as a trade mark. Alternatively either
(a) the Intellectual Property Office (and similar bodies across the world) don't see the two logos as sufficiently similar to prevent them being separately registered ; or
(b) the two companies are happy for the logos to co-exist anyway (because there's not much likelihood of their products being mixed up).
Further, logos are registered as trade marks within 'image classes'. Once a logo has been registered within, say, the 'clothing' class it can't be registered or used by any other company for clothing. However a different company could register the same (or a very similar) logo as their trade mark for, say, tractor parts.
Click through the 'Next' links here to view some remarkably similar logos:
http://whatculture.com/offbeat/10-massive-companies-unbelievably-similar-logos