When you bring home a little piglet, you want to be socializing it in a way that makes the piglet feel comfortable. In the first day or two, keep your distance. Know that that pig needs his space. Not space, but personal space. Don't try to hold him and love on him right away. Let him get used to you. Think of him more as a child than you are a pig, or a pet, or a dog. Think of him more as a child than you would a dog. They need to begin to trust that their environment is safe, and that those that are in their environment are safe. So make your little pen area for your piglet so that it has a bed and a litter box and a place to eat. And then take your cues from the pig. Some piglets are very social right from the get-go, and others are very anxious and worried and concerned.
Get down to their level. When they're looking at you for attention, you don't need to have food all the time. In fact, get rid of the food. Just be in their space. Pet them if they allow you to pet them. Nice, gentle strokes. If that's as close as they want you to be that first day, then that's fine. The calmer you are, the more calm the pig's going to be. And when they come to you and ask for attention, give it to him. You don't have to be hanging over them like this. It scares them. They want to go backwards. So instead of leaning forward to them, lean backwards and let them come to you. Pigs are aware that your company doesn't belong in their house, in their nest, and they sometimes protest. So when you have a pig, especially when it's a young pig and you're just bringing it home, try not to overwhelm it with visitors, and if so, then let the visitors look, but really not try to overwhelm the animal.
To socialize your pig with other pets that you have in the house, the dog in particular, you should be sure that the dog is contained with a leash on it, and then see how they get along, and just observe. Sometimes it'll be easy socializing between the two of them, very easy introduction between the two of them, and sometimes it can be very difficult. So be sure that you recognize that the pig is not playing with your dog, if it is trying to fight the dog. It's not playing. It's actually trying to defend itself.
When socializing with children, you can have them sit in the pig's playpen area, but make sure that there's not a lot of running around. They don't like loud noises, and they don't like fast movement, so sometimes that with young children can be difficult. Once the pig has established that this is fine, the child is fine to run around the house. It doesn't have to be forever. Be sure that the pig and the child have a nice introduction at the very beginning.