"D'ailleurs": the literal meaning is "from elsewhere". De=from; ailleurs=elsewhere.
Its used to complete an idea that has been evoked just before.
"By the way" is more like "Au fait". It doesnt have a connection with what was said before. It actually introduces a new idea.
A: Au fait, vas tu partir en vacances avec eux?
B: Non. C'est trop cher. D'ailleurs, j'ai plusieurs rendez-vous importants la semaine prochaine.
The excuse of the meetings CCOMPLETE the first excuse of the trip being too expensive...
In english you'd say something like:
A: By the way, will you go on vacation with'em?
B: No. It's too far. Besides, I have important meetings coming up.
... hope that helps