We had an older piglet in our goat yard for a few weeks and she was fine, although would nip at the goats if they tried to butt her.
As I mentioned in another post, our two calves are fine with the goats as well.
I think it depends on the pig and how old it is and what breed as well. Some breeds of pigs (or here at least) live with bottle kids and lambs, some with chickens and some inside with little children. If you get a young pig or one that is very gentle and quiet then it should be fine as long as care is taken to monitor their interaction and steps taken if things look to go awry. Putting any animal that is known to be vicious or mean in with goats (or any other animal for that matter) is obviously not very wise.