Do you have a close pharmacy that you can purchase the peroxide and give it within the hour?
It will say do not give orally but that's because it is an irritant that will make him vomit, which is what we want now!
It may pass but since he just ate it, within the past couple of hours, it's worth trying to get him to vomit it back up.
You can give him 3 tablespoon of FRESH 3% hydrogen peroxide soaked up with bread or a small amount of dog food.
Then take him outside and run him around to get the peroxide bubbling so it irritates his stomach lining and he vomits.
If no vomiting in 10 minutes repeat the peroxide dose once.
If he vomits and seems to clear his stomach and be done I would check to see if the sock is present.
If the sock is present wait 10 to 15 minutes to be sure he is done vomiting and then to try and settle his stomach give an over the counter acid reducer that people take for acid reflux, either:
1) Pepcid-ac (famotidine) at a dose of one 10mg tablet every 12 hours.
2) Prilosec (omeprazole) at a dose of one 20mg tablet every 12-24 hours.
3) Zantac (ranitidine) at a dose of 1/2 of a 75mg tablet every 8 hours
These will reduce stomach acid and should help settle his stomach.
Then feed a homemade diet of 1/3 boiled hamburger or white, skinless chicken, all fats and juices drained and 2/3 white rice. Add 2-3 tablespoons of canned pumpkin or fresh cooked pumpkin, (not pie filling, just pumpkin), to each meal for fiber if he doesn’t vomit the sock body to help push the sock through.
If you don't have peroxide you can get him to an emergency clinic to induce vomiting.
If he doesn't vomit it back up or you choose not to take him to an emergency clinic still use the bland diet with pumpkin to try and get the sock to pass.
If he doesn't vomit the sock later signs to watch for that indicate trouble are if he starts vomiting, has a tense painful belly or refuses to eat or runs a fever (more than 103F rectally) then that can signify a blockage and he should be seen by a veterinarian immediately. Surgery may be needed at that point.