They are safe to eat and delicious! Just don't overcook them or they will be dry and mealy. I get them whenever they go on sale.
Yeah, it's preferable to get all meats from pastured animals, but I think liver is so nutritious that it will do you more good than harm. I also think that factory-farmed meat is not as "toxic" as some people make it out to be. I buy local and grassfed when I can, but it's not always feasible.
See this: Primal Wisdom: A Practically Primal Perspective on Conventional Beef, Part 1: Hormones