Whistles are not part of the formalised dispatch process in the Rule Book, although local regulations may require them as an additional item to be used (or carried by certain staff, etc. etc.).
It therefore follows that they technically shouldn't be used as an alternative to, or implication of, any signal to be given under the Rule Book. Therefore hopefully safety was maintained. Obviously this is quite sensible - it is relatively easy for a member of the public to acquire a whistle, less so a dispatch bat, full GWR uniform, or RA indicator!
However... being sensible for a moment.
This is, of course, a rather stupid thing for bystanders to be doing. It only takes a moment of misjudgment at the end of a long shift to interpret a whistle as something which it isn't, such as an indication of the train being safe to proceed.
I would hope platform staff would "encourage" this not to be done, if they felt it necessary.
There are various byelaws which can apply to using audio devices and musical instruments on stations, and behaving inconsiderately. If the worst came to the worst, these could be enforced, I'm sure.
There are circumstances where non-uniformed staff could be using a whistle. One such occasion is when managers need to stop a candidate who is being assessed. The candidate may be briefed that the relevant person blowing a whistle would be a signal to stop what they are doing. If someone is blowing a whistle repeatedly and nobody is taking much notice, chances are that this is not the case.