I looked up fennel. The article I found said fennel is a fine feed for goats and is said to increase milk production. Do not overfeed to pregnant goats because it may cause uterine contractions..
If the goats like it chances are it is safe. Goats like a lot of weeds. You could take a sample to the farm advisor's office if you like, but if it were me, I'd let them eat it.