I'm allergic to penicillin, can I take keflex?

Maybe. Penicillins (like amoxil) & cephalosporins (like keflex) are both beta-lactam antibiotics named because of their ringed chemical structure. Allergy to penicillins is sometimes directed against this ring, and an allergic reaction may also occur if a similar antibiotic is taken. It is estimated that about 10% of penicillin-allergic patients are also allergic to cephalosporins like keflex.
Probably. Most doctors are concerned about cross reactivity between penicillins and cephalosporins, including keflex. In actuality, the cross-reactivity is uncommon between these two classes. Also, most people who think that they are allergic to penicillin are not. An allergist can test to see wether you are allergic to penicillin. He could also confirm whether it would be safe to take keflex.