It depends on what you mean by legal
It wouldn't be a criminal offence (in UK at least) but a civil one. In some countries, the word copy right simply means the right to copy. So, technically, they would be going against the copyright laws if they just used the questions as issued by JAA/EASA or whoever.
The PPL Confuser, for example, is a flagrant breach of copyright laws because whoever wrote it simply cut and pasted the questions as issued by the CAA. Other books
may have structured questions in a similar style, but without using the actual questions themselves.