They can be related in some cases (see comments). The p-value is formally defined as the probability under the null hypothesis of observing the same or a more extreme result than that in your sample. 0.05 represents a rule of thumb cutoff for this value to be considered significant.
The confidence interval is a plausible range of numbers for the true population value of the parameter of interest. Formally, if one collected a sample and calculated a 95% confidence interval, then repeated collection and calculation a further 99 times, 95 of those 100 intervals are expected to contain the true value of the population parameter.
The link between p-values and confidence intervals is this: if you test, for example, the null hypothesis that a certain parameter, say the population mean, is different from 0, and reject this null hypothesis because you calculate from your sample a p-value < 0.05, the 95% confidence interval calculated from this sample will not overlap with 0. Similarly, if we fail to reject the null hypothesis (i.e., calculate a p-value > 0.05), then the 95% confidence interval will overlap with 0.
For odds ratios, it's a little different, because testing if the odds ratio is statistically significantly different from 1 is the same as testing if the two different groups have different odds. So usually the null hypothesis tested is that the odds ratio is equal to 1, and we check to see if the 95% confidence interval overlaps with 1. If you reject the null hypothesis (at a significance level of 0.05), then the 95% CI won't overlap with 1.
ADDENDUM: this relationship holds because for a given significance level $\alpha$, the corresponding confidence level is 100%(1 - $\alpha$), so for $\alpha$ = 0.05, 100%(1 - 0.05) = 95%
EXTRA ADDENDUM: Alexis correctly pointed out that this only holds for certain tests and CIs, and isn't a general rule.