This is possible on code128 barcode. This kind of barcode accepts not only numbers but also chars. Usually consumers deal with EAN13 barcode on the supermarket, they only accept numbers and this attack is impossible.
But if the barcode contains control characters, it acts like a keyboard macro and will send them to the application. So if I embed a Ctrl-S in my hostile barcode, I can tell the software to save the record with data I supplied.
So far as attacks via UPC/EAN/IAN, they're not really possible as it only encodes digits, and only 13 of them.
¹ https://en.wikipedia.org/wiki/International_Article_Number_(...