Some drugstores in the Czech Republic introduced washing detergents filling machines. Customers can refill their empty bottles with various products so they don’t have to buy a new one everytime
This is actually pretty common for eggs in some form.
Eggs are usually sold in recycled cardboard in europe so packaging isn’t really much of a problem with that but there are also many stores with eggs on a tray and you can put them in your own cardboard container.
I guess most people just take a new box as again that cardboard isn’t really an issue but people won’t stop you from simply reusing your old box.
Milk is difficult though.
The reason why you can do this with laundry detergent or even soap or shower gel is that those things tend to not go bad and even if they did it’s not much of an issue.
Milk is something you consume that needs to be cooled and actually gets bad pretty fast. Add to it that the machine itself needs to be cleaned all the time bacteria growth within the machine easily contaminates the milk.
This turns it into worrisome at best and an actual health hazard at worst. Doing this kind of stuff for food and drinks is sadly not really an option.
Altought in saying that there are stores around the world that focus on selling only bulk products where you provide the containers.
For the US, here’s a state-by-state list of such stores. It’s a good start, but would like to see Target and the like get on board too.