Yes, you can. First, obtain the orbs tied to Dialga and Palkia. Then head to Celestic Town and speak with the elder in the house above the ruins. Once she finishes talking, make your way to Spear Pillar and move forward until you spot a blue portal, that's your Dialga encounter.
After you've caught or defeated Dialga, step outside and back in. You'll see a purple portal roughly where the blue one was, and that leads to Palkia. One catch: this sequence only works if you've already encountered a Ditto. Hope that clears things up!