Of course it is legal. In the same way as it is legal to set the sale price for (most) things at any (arbitrarily high, or low) value - airline ticketing takes place in a free market.
This means sellers can offer tickets at any price they want, and it is up to the purchaser to signal whether they think the price is appropriate by buying the ticket (or not) at some price. The alternative is government interference or regulation of the airline ticket industry, setting fixed prices, which would not be good for the industry.