It depends on why that person went to jail. If this person is potentially harmful to themselves or others, I personally would not allow the child to visit in jail, both as a punishment for the partner in question and as a mental safety net for the children.
If my partner was thrown in jail for something small like a fight in the parking lot because someone said something that was unacceptable to someone else (making fun of someone, etc) then I would of course let my children visit their parent in jail.
If my partner was thrown in jail for something bigger like drug addiction/dealing, hurting someone unjustly, drunk driving and they hit someone, etc. then no, I would not allow my children to visit them in jail. I would simply to go ask why, and decide if my relationship is worth salvaging at that point.
Bail money isn't cheap, but it's doable. Trust in a relationship/family is priceless and it's hard to earn back.