is it safe to install asterisk and freepbx on public vps ?
By VPS I presume you mean a virtual machine offered from a remote, service provider’s, site.
Running on a virtual machine where the host workload is out of your control is likely to produce choppy audio.
The system should be as secure as a real system with the same firewalling and Asterisk configuration.
Given the fact you need to ask the question, the answer is no.