While both are technically grammatically correct, in general, using the past tense for that sort of question is more idiomatic and sounds more natural:
Where did this come from?
Using the present perfect in this case may sound a bit strange.
However, the present perfect form is sometimes used to imply that the asker is more interested not in knowing where it was before, but rather how it came to be here now:
Q: Where did this plant come from?
A: It came from Mary's house. She was getting rid of it.
vs.
Q: Where has this plant come from?
A: Oh, I brought that over yesterday.
The present perfect is also used more often / interchangeably when talking about ideas rather than physical objects, to ask about the process by which something came about. As an example, these two statements mean pretty much the same thing, and both sound perfectly natural:
Where did this change of opinion come from?
Where has this change of opinion come from?
But in general, if you're talking about a physical thing, and you want to know where it was before it was here, the simple past form is usually what you want.
As a side-note, when responding to a question in the present perfect, the answer is usually stated simply in the past tense, so even assuming the present perfect was correct for the question, this answer doesn't really sound right:
It's come from Dallas, 5 miles from here.
Instead, that case should probably be phrased as:
Q: Dude, where has this come from?
A: It came from Dallas, 5 miles from here.