In basic transformer theory, you can. Whether a transformer steps the voltage up or down depends on the windings in the primary and secondary. If you reverse the input and output with the primary and secondary, it will function in the reverse way.
That's theory. In real life, transformers have current ratings. If the swap changes the amount of current or if it's an isolation transformer, the reversal may not work and could damage the transformer or connected components..