Is it safe to log in using links received through SMS, email or messaging apps?

Updated