During your turn, if you can pay the retreat cost some way, sure.
If it has a free retreat, go right ahead.
If it has a retreat cost of one, then you have to attach an energy card and then discard it to retreat.
But there is no restriction on retreating other than doing it just once per turn, as long as you can pay the retreat cost, if any.