Online play depends on the console's internet connection rather than the disc, so a connected Wii will connect.
That said, pirated copies are illegal, and Nintendo has historically banned consoles detected running them. The risk falls on the hardware, which is a fairly steep price for a game.