Pigs can be kept outdoors or in confinement. In confinement they often have a pen or stall all to themselves where they eat, drink and sleep. Boars are often in a separate pen to the sows and gilts...
i myself wouldn't do it unless you check with the person you got the pig from or a vet when you take it there next! have fun with your piggy, PS. you can feed it fig newtons and vanilla wafers.