Can a voltaic pile be used as a capacitor?
A capacitor and battery are just models that we use to describe physical processes. Capacitors are defined as the effect of the electric field between two plates of metal, and there doesn't have to be a dielectric. The dielectric modifies the electric field between plates.
The dielectric is from a dipole moment of the electric field and is dependent on the material

$$ E_{effective} = \frac{\sigma}{k\epsilon_0}$$

This changes the capacitance $$ C = \frac{k\epsilon_0A}{d} $$ by a factor of k (the k factor being related to the dielectric effect of the material)

Batteries have some internal capacitance, because they have plates of metal in them, but they also generate a voltage because of the ionic processes. One way to simply model a battery would be this:







simulate this circuit &ndash; Schematic created using CircuitLab

In a battery the ionic processes are going to dominate the charging of any 'capacitance' of the cell (the voltage source is connected directly to the 'capacitor' created by the cell plates).
You can stack cells together but you aren't going to be able to measure or see many effects from this capacitance. There are more complex models of batteries, but this is a way to illustrate what would happen. It really isn't going to affect anything in the DC sense, and it would be silly to run an AC current through the battery.