Does penicillin work to get rid of conjunctivitis?

Rarely. Only a very specific (and serious) form of conjunctivitis is treated with penicillin (gonococcal). Most pink eye is viral and does not require or respond to antibiotics.
Generally... ...Not the first choice, though it will probably work in some cases.