Yes, they can work in the UK on a Dependent Visa in the Tier 2 stream. The conditions of employment will specify that you can be employed until the time your Dependent Visa is valid. You will be dependent on the Partner/spouse for your dependent status. So once the term of the Primary Visa holder expires, your employment will also end.