Polls can be accurate, but you need to avoid pitfalls like sampling bias, eliminate as many confounding variables as possible, and minimize the amount of assumptions put into the statistical analyses. The Rasmussen poll, for instance, had a huge red flag by running on the assumption that Trump would only get 74% of the Republican vote. Who knows how many more ill-advised assumptions Rasmussen and others made.
Another thing to mention is that pointing towards the margin of error does not prove a poll's accuracy. The margin of error is the confidence interval, of which the range largely depends on the level of confidence you set it at. A 65% CI will have a smaller interval than a 95% CI, which will have a smaller interval than a 99% CI. Confidence intervals are dependent on the consistency of the samples. You simply need to calculate the standard deviation and then, divide it by the square root of the sample size. This is what we call the standard error. Lastly, you multiply the SE by 2 and then add/subtract it from the mean.
If there is more variability between samples, then the CI will be large. The thing is, though, is that you can use an absolutely shit methodology and still get consistent results. Precision is not the same as accuracy. You can be precise, but be very inaccurate.