"A legendary creature can take a certain number of special actions--called legendary actions--outside its turn."
"it can't use them while incapacitated or otherwise unable to take actions."
You are able to take actions and are not incapacitated.
Both bonus actions and legendary actions are special kinds of actions.
If you can use a legendary action, you could probably also use a bonus action while turned, as any words about "on your turn" are split off by "also you cannot take reactions", making the tie to "on turn" actions very tenuous.
I'd be tempted to allow it, as any legendary creature is (a) budget-wise like 4ish creatures, (b) big bad evil enough that shutting it down sort of sucks.
On the other hand, many legendary action creatures have legendary resistances. And if you let a turn undead through it means you are probably already pretty much defeated.
I copied the rule here: A turned creature must spend its turns trying to move as far away from you as it can, and it can't willingly move to a space within 30 feet of you. It also can't take Reactions. For its action, it can use only the Dash action or try to escape from an Effect that prevents it from moving.
I would tend to think that they cannot take reactions, that they also cannot take legendary actions. I may give them an ability to make another turn check each round to compensate and a legendary action to make a new save at the time.
You could also make undead with these abilities immune to turning. If the creature is that powerful and most likely the BBEG of the adventure you want them to be able to fight.
RAW is ambiguous, but as a DM I would be inclined to say if it's turned it's turned - and yes, as stated, an undead that has legendary actions is likely to have legendary resistances AND turn resistance. If somebody got through all that and managed to successfully turn the creature, I think the DM should let them have it.
In terms of it bringing an anticlimactic end to, say, a campaign-ending fight, it doesn't seem likely since in most cases by virtue of the plot the adventurers will want that creature destroyed, not just "running away for one minute". And damaging the creature breaks the turning effect. So turning a really powerful undead during a climactic encounter could provide a huge advantage but probably not a decisive end to the creature. And if somehow the undead does end up fleeing the encounter completely, you have a recurring villain for a future campaign.
Are there any Legendary Action options that would really interfere with the concept of being turned? If not, I'm not sure it there is much reason to disallow them. Melee attacks would be limited to targets you happen to be adjacent to when your Legendary Actions trigger. Movement would still be compelled to moving away from the turning character. Being able to toss a spell or ranged attack while fleeing doesn't seem like a huge problem necessarily, but I might be wrong.
"For its action, it can take only the Dash action or attempt to escape from an effect that prevents it from moving."
I would be inclined to interpret this broadly and say it applies to legendary actions as well. So, it can only take a legendary action if a) that action is the Dash action or b) that action can help it escape from an effect that prevents it from moving.
You could certainly argue the other way, but I feel this ruling is more in line with the intent of Turn Undead and is also a better result in game. As @Burnside points out, forcing a turn attempt through against a legendary undead is not at all easy, and it doesn't permanently dispose of the target; so I think it makes sense to let the players have that temporary victory.