We describe fivebrane configurations in M theory whose 4-d spacetime contains N=1 supersymmetric Sp or SO gauge fields and fundamentals of these groups. We show how field-theory dualities for Sp and SO groups can be derived using these fivebrane configurations in M theory.