On android, Google lens in pixel can do it and few other manufacturers like OnePlus have deeper integration with Google Lens via their camera app but needs to be installed separately.
I support the idea of having built-in barcode reader which can scan barcode from the screen as well e.g. images in webpage.
A QR code is the best of both worlds.