If you are not sure what it is, then please don't risk trying it. Peppers are part of the solanum family, which includes some very toxic weeds. A looky-likey could be where a plant died and a weed seeded into the pot.
I had a lady come into the garden centre I work at for advice with a deadly nightshade plant she had been growing as a black chilli. What was worse, her husband had eaten a couple of fruits
She was totally unconcerned and said he was fine but I worried about that for quite a while