Yes, you can use a hyphen in the domain name. However, hyphens are not allowed at all in some TLDs like .us (.co .nyc .me .bike .accountant) and even some ccTLDs (e.g. de). So before deciding on a domain name - be sure to check if it's valid for your target TLD/ccTLD. Otherwise, you'll waste time, money, and nerves trying to register it only to find out later that it is invalid.