A bay pen isnt illegal, however what is illegal is catching, whether it be inside or out if the hog is restrained in any way shape or form. if your dog simply bays and doesnt touch the hog your good, one nip and your screwed.

That being said i dont know of any Law Enforcement agency that would enforce it, with the exception of Animal Control.