Is the sample proportion ($\hat p$) a random variable? Since it should vary from sample to sample, I suppose it should be a random variable. But if it is, when we write the variance of sample proportions, should we write an uppercase P-hat as the index notation of sigma?
But in most textbooks and formula tables, it seems that a lowercase p-hat is usually used



I don't see a $\hat{p}$ in the figure you posted, but from the formula in the figure, $p_1$ and $p_2$ are statistics. Once you calculate a statistic, it becomes a realization of the random variable (Be aware that I am not saying that your statistic is the true population parameter).
Above all, remember that in most cases upper/lower cases are conventions. They might be widespread, which can be helpful in many cases, but there is no law that forces you to write a random variable's "name" in uppercase. It's common for introductory (and even advanced) books to have a discussion on symbols and style. That section will help you understand the notation the author(s) has adopted.
