HSC Papers say "Write using black or blue pen. Black pen is preferred" - there's no mention of pencils. On Science papers they specify to use pencil for diagrams, so I'd suggest using pen. If you're not confident maybe do it roughly in pencil and then go over it in pen?
You are technically allowed (in the sense that they won't give you 0 purely for using pencil), but remember that these papers are scanned, then marked, so pencil would not come out as clearly as pen. It can also rub off/fade over a short period of time too.