A transformer cannot work on direct current (DC). Transformers rely on the principle of electromagnetic induction, which requires a changing magnetic field to induce voltage in the secondary coil. For this to happen, the current must be alternating (AC), because DC provides a constant current that doesn't vary over time.
When DC is applied to a transformer, it initially creates a magnetic field, but after that, the field remains constant, and no voltage is induced in the secondary winding. This causes the transformer to either heat up or malfunction since the core may saturate.
In short, transformers are designed to work with alternating current (AC), not DC.