This question is relevant specifically to creatures with a reach equal to 0', as they have to go into opponents' squares in order to attack. From Big and Little Creatures in Combat:
Tiny, Diminutive, and Fine Creatures: Very small creatures take up less than 1 square of space. This means that more than one such creature can fit into a single square. A Tiny creature typically occupies a space only 2-1/2 feet across, so four can fit into a single square. 25 Diminutive creatures or 100 Fine creatures can fit into a single square. Creatures that take up less than 1 square of space typically have a natural reach of 0 feet, meaning they can't reach into adjacent squares. They must enter an opponent's square to attack in melee. This provokes an attack of opportunity from the opponent. You can attack into your own square if you need to, so you can attack such creatures normally. Since they have no natural reach, they do not threaten the squares around them. You can move past them without provoking attacks of opportunity. They also can't flank an enemy.
So these creatures usually have two chances to generate attacks of opportunity (AoO) while moving when attacking, one for leaving the threatened square in front of the opponent, and another for entering into the opponent's square (this AoO only for the opponent). You can avoid though the first with a 5-foot step:
Moving: Moving out of a threatened square usually provokes attacks of opportunity from threatening opponents. There are two common methods of avoiding such an attack—the 5-foot step and the withdraw action.
But the second one is not generated by going out itself but by the action of geting into the opponents square. The 5-foot step rule text says though:
Take 5-Foot Step You can move 5 feet in any round when you don't perform any other kind of movement. Taking this 5-foot step never provokes an attack of opportunity. You can't take more than one 5-foot step in a round, and you can't take a 5-foot step in the same round that you move any distance.
So, technically it just means the 5-foot step action does not generate an AoO by itself. Never. But does conditions that produce the 5-foot step action itself generate? The going out of threatened is clearly stated in the rules as no, but in the case of going into occupied square it is not clearly stated.