WordPress, as a platform, is more secure than many others. However, there are always vulnerabilities in any service you use. The more popular a platform is, the more likely that people are going to try and crack its defenses.
If you think your website has been hacked, it’s good to determine the nature of the hack as soon as possible. There are many different types of hacks and some hacks can be malicious. Other hacks are just defacements to your actual web pages.