Dear Sheelnath Kekre,
Thank you for reaching out to the Microsoft Q&A.
Yes, you can still activate Windows 7 and Windows 8.1. If you have a valid and unused product key for the specific edition you are installing (e.g., Windows 7 Professional, Windows 8.1 Home), the activation process should still work.
While you can technically activate and use Windows 7 and 8.1, it is highly discouraged for any computer that will be connected to the internet.
Support for Windows 7 ended in January 2020, and for Windows 8.1 in January 2023. This means there have been no security patches for years. Your computer is vulnerable to all malware, ransomware, and viruses discovered since support ended.
To assist others who might have similar questions and to help us improve our support system, we kindly encourage you to "Accept the answer" if it successfully addressed your concern. Accepting an answer lets other users know that this solution worked for you, and it also helps us track the effectiveness of our support efforts.
Best regards,
Bryan Vu | Microsoft Q&A Support Specialist