Kinda
The closest thing to a specific rule on this is the rule for moving through an occupied friendly squareThe closest thing to a specific rule on this is the rule for moving through an occupied friendly square:
You can move through a square occupied by a friendly character, unless you are charging. When you move through a square occupied by a friendly character, that character doesn't provide you with cover.
So, if the creature wants to let you move through its square, you could just rule that it's "friendly" at that particular moment.
This can lead to some weird cases when dealing with invisible creatures through, where you're "friendly" to let someone through, which causes them to move to a spot that's better for you, at which point you cease being friendly and take an AoO against them (or your turn comes and you can full attack). Players might want to use that tactic, but it can look suspiciously like DM cheese when NPCs do it.
It's generally simpler in the case of friendly vs hostile movement to just say "you bump into something and can't enter that square", which is how the rule works normally. They won't know what they bumped into, just that something invisible is there. If you did want to allow someone to let another creature through, I'd consider a house rule where they can't declare themselves friendly and unfriendly in the same turn. Thta is, if they do let the creature through by being "friendly", they can't immediately turn hostile and take an AoO on the same turn.