You can see the word count, and if the word count is already in the doc, it’ll show up in Word Online. But you can’t add the word count to your doc from Word Online.
If you have the Word desktop application, click the Open in Word command (or Edit Document > Edit in Word), and follow the steps in Insert the word count in your document. When you’re done and you save the document, it’ll continue to be stored where you opened it in Word Online. When you reopen it, the word count will be there.