You could remove the rows where A and B both contain NA values and then run intersect().
df <- data.frame(A = c("cat", "dog", "duck", NA),
B = c("dog", "elephant", NA, NA))
df_new <- subset(df, !is.na(A) & !is.na(B))
intersect(df_new$A, df_new$B)
#> [1] "dog"
Created on 2020-05-11 by the reprex package (v0.3.0)