The claim that the margin of error is $4.9$% follows from assuming that the poll was conducted as if a box had been filled with tickets--one for each member of the entire population (of "hardcore Republican voters")--thoroughly mixed, $400$ of those were blindly taken out, and each of the associated $400$ voters had written complete answers to all the poll questions on their tickets. These $400$ poll results are the "sample."
The "as if" raises plenty of practical questions that go to whether the poll really can be viewed as arising in such a way. (Can we really think of the population as represented by a definite set of tickets? Is it fair to assume all tickets are completely filled out? Was the sampling conducted in a manner akin to drawing from a thoroughly mixed box? Etc.) Other respondents have listed some of those questions. Granting, however, that this is an adequate model of the poll leads us to the crux of the question: to what extent do these $400$ tickets represent the entire population? We never know for sure, but we can develop some expectations by studying this process of sampling from a box of tickets.
To do this, we focus on one question at a time. We might as well view each ticket as bearing either the "yes" or "no" answer for that question. We now compare the true survey results (that is, the true proportions of yeses among all tickets in the box) to the results of the myriad possible samples of $400$ tickets. (There are more than $1.9 \times 10^{1475}$ such samples.) We have to make the comparison for any possible true proportion, but even so, it's merely a matter of mathematical calculation. This calculation shows that the observed response in at least $95$% of all such samples lies within $\pm 4.9$% of the population value no matter what that population value might be. For example, if exactly $50$% of the tickets in the box are "yes," then $95$% of the possible samples of $400$ tickets will contain between $50-4.9$% = $45.1$% and $50+4.9$% = $54.9$ yeses.
(That computed value of $95$% actually depends on the true proportion of yeses in the population: if that proportion is very small or very large, we find that quite a bit more than $95$% of all samples will give results accurate to within the margin of error. A true proportion of $50$% is the worst case, which is used because we don't know the true proportion!)
This is all the margin of error means. Because $95$% is a substantial fraction of all possible samples, we feel it's highly likely that the one sample that was actually obtained will be among these $95$%. A doubter is allowed to suppose the sample could be one of the remaining $5$%: we cannot prove him wrong (based only on the poll results, anyway). Yet, similar calculations show (for instance) that the proportion of yeses will differ from the true proportion by more than $12.2$% in only one of every million possible samples. It's still possible the poll is among these one-in-a-million samples, but we have very shaky grounds to believe that. Thus, there is usually a limit to what constitutes a "reasonable" amount of doubt about what the true proportion may be, and it's rarely as extreme as $\pm 100$%.
The fundamental insight afforded by these calculations is that once the number of tickets in the box becomes moderately large (a few thousand in this case), the margin of error does not depend on how many tickets are in the box. It should be intuitively clear that the only thing that really matters for a relatively small sample is the proportion of yeses in the box, because the proportion determines the chance of drawing a "yes" or "no" and that proportion doesn't appreciably change between drawing the first and drawing the last of the $400$ tickets.
In summary, assuming it's accurate to view the poll as acting like drawing tickets from a box, our right to "extrapolate" from the poll to the population (a process more formally known as statistical inference) is an uncertain one, because we can always be wrong; but when the sample is just a small fraction of the population, the amount by which we might be in error in making that extrapolation depends primarily on the size of the sample, not the size of the population. This is why most credible polls, whether of local or international scope, use samples of a few hundred to a few thousand. It is rare that larger samples are needed to achieve a high chance of getting reasonable accuracy.