There were a mixture of homemade and shop-bought items. The latter could've been ordered by owl.
Let's look at the presents which are given and received by the trio in the first two books.
Harry Potter and the Philosopher's Stone:
- A wooden flute, given to Harry by Hagrid.
- A jumper and some fudge, given to both Ron and Harry by Mrs Weasley.
- A large box of Chocolate Frogs, given to Harry by Hermione.
- A box of Every-Flavour Beans, given to Ron by Hermione.
- James Potter's Invisibility Cloak, given to Harry by Dumbledore.
Harry Potter and the Chamber of Secrets:
- A large tin of treacle fudge, given to Harry by Hagrid.
- A copy of Flying with the Cannons (a book), given to Harry by Ron.
- A luxury eagle-feather quill, given to Harry by Hermione.
- A knitted jumper and a large plum cake, given to Harry by Mrs Weasley.
I've ignored the non-gifts from the Dursleys, which I think shouldn't really count.
From this list we can see that quite a few of the gifts are homemade.
It was wrapped in thick brown paper and scrawled across it was To Harry, from Hagrid. Inside was a roughly cut wooden flute. Hagrid had obviously whittled it himself.
(Philosopher's Stone, Chapter 12, The Mirror of Erised).
Harry had torn open the parcel to find a thick, hand-knitted sweater in emerald green and a large box of homemade fudge.
(Philosopher's Stone, Chapter 12, The Mirror of Erised).
However, the homemade nature of some of the gifts certainly shouldn't imply that they were made because commercial alternatives weren't available. Hagrid and Mrs Weasley were more than capable of going to wizarding shops if they'd wanted to. They simply preferred the personal charm of homemade gifts.
As for the children, it's true to say that they couldn't have got the presents from Hogsmeade, since first- and second-years weren't permitted to go. It's highly unlikely though that they only gave unwanted items that they just happened to have lying around. The only possible exception is Flying with the Canons, which might conceivably be a second-hand book once owned by Ron. He doesn't come from a wealthy family, after all, so he probably didn't have a great deal of money available for presents. We also don't have a record of Ron buying Harry a present in year one, which again could imply limited means. It's possible that, knowing Harry's keen interest in Quidditch, Ron decided to give him one of his old books.
However, Hermione's presents were almost certainly shop-bought. It's unlikely that she would give Harry a second-hand quill. Additionally, Chocolate Frogs and Bertie Bott's Every Flavour Beans were commercially branded confectionary products. These weren't homemade imitations but mass-distributed household names. They had to be shop-bought by definition.
How could they get hold of the presents? I can think of a few options:
- The gifts were obtained in Hogsmeade and the trio simply asked older children (who had permisson to go) to buy the presents on their behalf.
- The kids bought the presents in Diagon Alley at the start of the year in the knowledge that shopping trips during termtime would be few and far between.
- As Mike. C. Ford suggests, Hermione could've bought her gifts from the first year in person in Diagon Alley and sent them on by owl (since she wasn't at Hogwarts for Christmas that year).
- The presents were ordered from Hogwarts by mail order. It's likely that businesses from both Hogsmeade and Diagon Alley would've operated an owl order system for remote customers, along the lines of Fred and George's operation. Hogwarts students would be able to avail themselves of this.
"Fred and George are driving Muriel up the wall, they're still operating an Owl Order business out of her back room."
(Deathly Hallows, Chapter 25, Shell Cottage).
It's highly unlikely that the presents were bought at Hogwarts. Valorum has found a good prop from one of the movies which suggests that there was, in movie canon, a tuck shop where students could buy some snacks. However, this shop doesn't appear in the books at all. Whenever students need to buy something, in both the books and the movies, they use Diagon Alley or Hogsmeade. For example, when Harry and Ron need to buy copies of Advanced Potion-Making for Potions midway through the school year they didn't use a school shop but sent away for copies to be delivered by owl from Flourish and Blotts. There's no precedent for any student buying things at Hogwarts (except on the black market). I think we can rule out Hogwarts as a source for the presents.