Let's break down going out of bounds.
Defensive players, there are no restrictions for defensive players going OOB and returning.
Offensive players on a passing play. No eligible reciever may go out of bounds and return to the field of play or the end zone and be the first to touch a legal forward pass. If the receiver is forced OOB by a defender and IF he returns to the field of play immediately, he can be the first to touch the pass.
If any player is clearly OOB and initiates a block on an opponent OOB, it is a personal foul at the spot the blocker crosses the sideline going OOB.
On a scrimmage kick play, (punt, fg) if Team A (kicking team) goes OOB on his own, or if he is blocked OOB and he doesn't attempt to return immediately, it is a 5 yard foul.