Yes, even 4 years olds can understand what sex they are--whether it shows externally or not.  More importantly, they can tell if they REALLY have to go to the bathroom and can't understand why they should have to soil themselves in order to placate the unfounded fears of the adults around them.