A handful of PS2 titles supported online play, and a smaller set could be linked across a local network. Wikipedia maintains a full list of PlayStation 2 network games, which is the most practical reference since it covers both categories.
Online play on the PS2 required the network adapter on the original models, plus a broadband connection and, for most games, a paid subscription. Titles like the SOCOM series and Final Fantasy XI were the flagship examples.
Keep expectations realistic today: the official servers for nearly all of these games have been shut down, so only private or fan-run alternatives remain.