Do you get your dexterity bonus against an invisible foe when you have uncanny dodge or not?
Sim, você faz.
O SRD do Pathfinder declara:
Uncanny Dodge (Ex)
At 2nd level, a barbarian gains the ability to react to danger before her senses would normally allow her to do so. She cannot be caught flat-footed, nor does she lose her Dex bonus to AC if the attacker is invisible.