$p$-adic analogues of hypergeometric identities and their applications