In the auction format, you can cancel an item as long as no winning bids have been placed.
For items listed at a Buy Now price, you can cancel the listing at any time. This includes situations where someone has clicked the 'Buy It Now' button, though cancellations in these cases are typically only possible within a brief window of time.