I'd assumed that keeping livestock on allotments was against the rules, but a Google.uk on "allotments + livestock" comes up with some indications that at least in some places it's OK. But I think pigs might be frowned on.
I see from Google that the RSPCA has a factsheet on "The Welfare of Animals on Allotments".