Vaginismus. Some people have involuntary muscle spasm of the vaginal muscles that prevent any penetration into the vagina. There can be numerous causes but usually it is psychologically related. Other causes can be congenital or acquired scar tissue at the opening of the vagina, walls internally that dont normally belong, or other causes of pain that cause voluntary spasm.
Vaginismus. If the problem developed over time and pain was associated then likely it is a result of the painful condition. Treatment for both will be required.