Yes they are. They’re both ruminants (plant eaters with special extra stomachs) and live in the wild in the same general area (southwest Asia), and share a common ancestor about four million years ago.
They also have important differences. Sheep have evolved to live in flat environments and can run quite fast on plains. Goats are specialized for “vertical” environments like mountains, and are quite awkward and slow on flat ground.