I work for a Council and we work flexitime. We work on 8 week periods when we can store up hours and if we have more than 7.3 hours stored up we can take a day off or use the hours to leave early.
At the end of the 8 week period we can carry over up to 30 hours and if we have more than that they can be taken off us in accordance with the terms of our contracts.
I was asked to do some urgent overtime towards the end of the 8 week period and had special authorisation to take time off in the next period a little while ago but this does not normally happen..
As this is common with councils I would imagine it is legal.