We’ve been using pencils in the UK to vote since the secret ballot was introduced in 1874. Originally, this was because the alternative was a fountain pen, which would need to be blotted, and you could tell how people voted from the blotting paper.
Curiously enough, someone asked the question “what’s to stop them rubbing out the votes and changing it?” before the law was passed. The answer is that we use copying pencils, which have a dye in the graphite so they can’t be erased. You can tell, because the writing isn’t shiny like a normal pencil.
Obviously, we’ve invented ball-point pens since 1874, and we could use them instead. But they do have disadvantages – they dry out, they can run out of ink, and cheap pens (the pencils cost 19p each) have a tendency to occasionally dump all their ink on the ballot paper in one go, ruining a ballot paper (obviously, you can issue a spare, but it’s still a nuisance). All of which means you need a few spare pens. The pencils, you can tell how long they have left at a glance – and the only maintenance you need is a sharpener.
So, no, you don’t need to bring a pen to vote securely – just check that the pencil has “SHAW’S” printed on the side and that the writing is matt, rather than glossy like a normal pencil.
ETA: The other advantage of pencils is that they don’t run if the paper gets wet. You can bring your own pen and use it if you are determined to do so – but make sure the ink is dry before it goes in the ballot box, that you haven’t used a distinctive colour that would allow your vote to be picked out, and that the ink won’t run if the ballot paper were to get wet – which doesn’t happen often, but I’ve seen ballot papers dried with a hairdryer after a clumsy voter spilled a bottle of water into the ballot box.