Some rule notes that may help clear this up, from the NFL Rulebook 2015 edition. However, it's likely that this is a highly technical issue that is hard to give a good answer to without game film.
Rule 3, section 2:
A recovery is made when a player inbounds secures possession of a loose ball after it has touched the ground.
Rule 3, section 2, article 7:
Item 2. Possession of Loose Ball. To gain possession of a loose ball that has been caught, intercepted, or recovered, a
player must have complete control of the ball and have both feet or any other part of his body, other than his hands,
completely on the ground inbounds, and then maintain control of the ball until he has clearly become a runner. A player
becomes a runner when he is capable of avoiding or warding off impending contact of an opponent. If the player loses the ball
while simultaneously touching both feet or any other part of his body to the ground, there is no possession. This rule applies in
the field of play and in the end zone.
So we know what a player has to do to secure possession: have the ball, and both feet or hands OR one elbow/knee/etc. in bounds. Just like a catch, and in fact there is later information that says the same - it has to continue through a trip to the ground, aka the Calvin Johnson rule, just like a pass. This should cover your second point, in part: regardless of anything else, the ball must be possessed in bounds, so a player out of bounds would have to reestablish in bounds. A player on top of an out of bounds player could only recover the ball if parts of him are in bounds.
Now, what about the ball being out of bounds/in bounds (ie, the first scenario)?
Rule 8, section 7 (Fumbles):
If a fumble goes backward and out of bounds, the ball is next put in play at the inbounds spot by the team that was last in possession
Note that the ball is what this is discussing, in terms of being 'out of bounds' (this is important, because there are some slight differences in what counts for ball vs. person). (The rule about 'forward' is similar.) So we go back to Rule 3, Section 21 to look at whether a ball is in bounds or out of bounds:
Item 2. Loose Ball. A loose ball is out of bounds when it touches a boundary line or anything that is on or outside such line,
including a player, an official, or a pylon.
A loose ball is out of bounds when it touches a player who is out of bounds. That means that in the first scenario, that ball instantly is out of bounds - it has touched a player out of bounds. It doesn't matter that it's the offensive player.
However, if the ball was determined to be in possession of the defensive player, the rule is different:
Item 1. Ball in Player Possession. A ball that is in player possession is out of bounds when the runner is out of bounds, or
when the ball touches a boundary line or anything that is on or outside such line, except another player or an official.
So if the ball is not yet recovered (per 3-2-7), the touching of the offensive player is sufficient to make it out of bounds. If the ball is recovered per 3-2-7, then touching the offensive player is irrelevant.
To specifically answer the question, if the conditions are as stated, in scenario 1 the ball is out of bounds and reverts to the team who last possessed it (regardless of side). In scenario 2, the ball is also likely out of bounds, but not definitely (as the player is not "out of bounds" until some part of him actually touches the ground), and the defensive player could theoretically touch down in bounds. NFL does not consider a player touching another player to be out of bounds:
ARTICLE 1. PLAYER OR OFFICIAL OUT OF BOUNDS. A player or an Official is Out of Bounds when he touches a
boundary line, or when he touches anything that is on or outside a boundary line, except a player, an official, or a pylon.