Yes, they are both correct. 오빠 means "older brother" when a girl says it. 형 means "older brother" when a guy says it. As Emily said, you don't have to be related to use it. In fact, it is a sign of closeness between friends. We use 동생 to mean "younger sibling" (male or female - there is no distinction unless you add 남+동생 for a guy, or 여+동생 for a girl).