Sure, you can buy a domain name without building a website.
It is common for people to do this to eventually build a website or sell the domain name at a higher price. Whatever your reason, buying a domain name without immediately building a website is perfectly fine.
You can park your domain name (unutilised but still active and not expired) until you are ready to use it.