No, a PlayStation 2 (PS2) cannot get a virus from playing online. Here's why:
The PS2 runs on a proprietary, closed architecture rather than a traditional operating system like Windows or macOS. This design prevents malicious code from infecting the console's core firmware.
PS2 games run directly from physical discs. The console lacks a hard drive or writable storage for user-installed software, eliminating the primary vector for virus persistence.
Unlike modern consoles, the PS2 was not designed to download software, firmware updates, or executable content from the internet. Online play was limited to matchmaking and basic data exchange within games.
Conclusion: While the PS2 is effectively immune to traditional viruses, standard precautions apply: only use legitimate game discs and be cautious with unofficial homebrew tools that modify system memory.