Yes it is safe, just make sure that you are buying bitcoin in legal way and into a trusted exchanges.
Firstly one should be knowing if their country has legalized it or not. If not than it is illegal to buy the crypto currency. If it has legalized than sue the most trusted exchange or if government has issued any licences to such exchanges so that you would not be scammed.