Yes, capacitor, is voltage sensitive device(C=dq/dv), hence must be connected in parallel to (source), the battery, with correct polarity, and hence could be charge along with battery, by dynamo, when car is running, could reduce the ripple too, as filter of the D.C supplied.......
Connecting capacitor in parallel with battery is very much possible. But if source is a dynamo (dc generator) then capacitor is helpful to smoothen the charging current under varying voltage as current will be proportional to generated dc voltage by dynamo and filtering effect is directly proportional to size/value of capacitor.
on the other hand if an alternator (ac generator) is used as source then connecting capacitor will result in excessive current near positive and negative peaks resulting in lots of vibrations and nonuniform loading. In that case it is adviseable to convert ac to dc with diode rectifiers and then use single switch(MOSFET OR IGBT) based buck-boost converter ( also known as dc-dc choppers). This will reduce ripple to near zero on load side (battery charging current) as well as equilization or uniform loading on source side (alternator ).