Is it safe to plug the connection end of a capacitor?
As long as you're using a non conductive resin and the cap is kept in a safe position to avoid wire breakages or other problems then it should be safe. That being said, if you're planning on using this for anything that would require to pass any safety codes or anything that by itself would not be sufficient, but for hobby/personal type stuff there should be no problem.