No, customization in Discourse is a little more restricted than that to keep everything working. Also, Discourse already comes with built-in view counters on topics.
Check out Customization > Theme for an idea of what you can create with the powerful theme customization system.