Do you need to buy a card when playing treasures in Dominion?
That's fine.  From the Dominion rules:

The cost of a card is in its lower left corner. The player may play some or all of the Treasure cards from his hand to his play area and add to their value the coins provided by Action cards played this turn. The player may then gain any card in the Supply of equal or lesser value. He takes the purchased card from its Supply pile and places it face-up on his Discard pile. He my not use the ability of the card when it is gained.

If the player has multiple Buys, he combines Treasure cards and any coins available from Action cards to pay for all of the purchases. For example, if Tyler has +1 Buy and 6 coins provided by two Gold cards, he can buy a Cellar costing 2, placing it face-up in his Discard pile. Then, he can buy a Smithy with the remaining 4 coins and place that face-up in his Discard pile. If he wants to use all 6 coins to buy one card, he can buy a Copper (for free) with his second Buy or not buy a second card. Players do not have to use any or all of their Buys.

(bolded for emphasis by me)

EDITED, to answer Chris' edit: Yes, it's fine to use Loan's "power" and then not buy anything.  As stated in the rules above, you play a Treasure card from your hand, in this case the Loan: at which point the Loan card's abilities kick in, and you carry out all the revealing, discarding and trashing.  Now you have (at least) 1 coin in your pool that you could spend on a Buy: but the rules make it clear that actually buying something is always optional, no matter how much cash or how many Buys you are entitled to!