Whether online poker is "safe" really depends on what you mean by the term.
Reputable, licensed sites use encryption to protect your data and money, but you should always research a platform's reputation, licensing, and payout history before depositing any funds.