Whether it is illegal to use other people's photos as QQ avatars depends on the situation. According to the provisions of relevant laws in China, it is an illegal act to use another person's photo as a portrait without the consent of others, and the infringee can ask the infringer to eliminate the impact. If you agree with me, it is not illegal.
Legal basis
Article 1018 of the Civil Code of the People's Republic of China
A natural person shall enjoy the right of portrait, and shall have the right to make, use, disclose or permit others to use his own portrait according to law. Portrait is an external image that can be recognized by a specific natural person reflected on a certain carrier through image, sculpture, painting and other ways.
Article 1019 of the Civil Code of the People's Republic of China
No organization or individual may infringe upon the right of another person's portrait by means of vilifying, defacing, or forging by means of information technology. Without the consent of the portrait right holder, no portrait of the portrait right holder may be made, used or made public, except as otherwise provided by law. Without the consent of the portrait right holder, the right holder of a portrait work may not use or disclose the portrait of the portrait right holder by means of publication, reproduction, distribution, lease, exhibition, etc.