The content's copyright status determines Nyaa's legality. Any anime you download or stream from a website that does not have the creators' approval is unlawful in most countries.