Most stick with apple branches. Willow should also be safe though and I give my degus wreaths made of willow branches to chew on. Maple is potentially dangerous. Ash I haven't heard either way on and I'll see if I can find anything. Problem with using logs though is that pigs pee where they sit so if they hide in something with a base it quickly becomes urine soaked and has to be thrown away. You either need open bottom houses so they sit directly on the bedding or houses that you can place something absorbent(like a handful of bedding) in the bottom and then dump them out daily or twice daily.
For other woods oak is toxic, fresh pine or evergreen of any kind should be avoided although dried pine boards are used to make houses, no woods from pitted fruits like mentioned above, black walnut is toxic.... That's all I can remember right now but if you ask about a specific wood I can try to look it up.