Yes, you can. You get the same credit for your review, regardless of whether the manuscript is published or not.
However, in order to maintain the author's privacy, we don't display any information about the manuscript until it is published. This means that your reviews of unpublished manuscripts will remain blind and the content cannot be displayed publicly.
In many cases rejected manuscripts cascade to other journals and are eventually published. At that point we allow you to sign your reviews and make the review content publicly available.
An example can be found here: https://publons.com/publon/43024/