Does current pass through an ideal battery?

A battery, ideal or not, does not follow Ohm’s law. Ohm’s law is an observed behavior of a specific class of materials/devices, sometimes called a constitutive equation. It is not a universal law of nature. Not all materials/devices obey it, including batteries.

An "ideal battery" doesn't have any structure inside. It is simply a mathematical abstraction of a device that produces a fixed voltage across its terminals. In order to do that, it absolutely must allow current to flow through it. In fact it must force a current through itself, in whatever amount is necessary to produce the required voltage across its terminals, given whatever circuit is connected to it.

But it doesn't obey the microscopic form of Ohm's Law because it doesn't have any internal structure with physical extent, and it doesn't have any material within it that could be characterized by conductivity. The materials inside physical (as opposed to ideal) batteries also don't follow Ohm's Law because for one thing the material is not uniform. There are multiple materials involved in the chemical reactions that produce the voltage across the terminals. And for another thing because those chemical reactions are producing ion concentration gradients in the electrolyte that counter any current that would be expected due to the electric field.

It also doesn't obey the macroscopic form of Ohm's Law ($V=IR$) because it isn't a resistor, and this form of Ohm's Law is essentially the definition of what it means for a device to be an ideal resistor. If your device followed this "law", it would be a resistor and not a battery.