Yes, a soccer game can end on a dead ball but many referees will let one last play happen before whistling to signal the end of the game.