Suppose the interface between $A$ and $B$ is a "nice" two dimensional surface. Then it appears enough if at least one of $A,B$ is a convex set. I don't know of an example where neither is convex and your property holds, and it seems offhand that if both are convex the interface should be a plane (but I haven't really proved that last thing).
Here's the argument, assuming without loss that it is $A$ which is assumed to be convex. Now assume there are points $P \in A$ and $Q \in B$ and that segment $PQ$ cuts through the interface $I$ (common boundary of $A,B$) more than once. After wiggling segment $PQ$ a bit we may assume it meets $I$ transversely when it does meet it, so that while moving along segment $PQ$ the points are alternately in set $A$ or set $B.$ It starts in set $A,$ eventually crossing $I$ the first time when it is then in $B,$ and upon crossing $I$ a second time it is back in $A.$ But this gives a segment starting at $P$ and ending at some point $R$ on segment $PQ,$ for which both $P,R$ are in $A$ but there is a point in between $P$ and $R$ which is not in $A,$ against our assumption that $A$ is convex.
Some details need to be supplied. In particular it's probably good to use $A,B$ for the parts which do not include the interface $I,$ so that when we say e.g. let $P$ be a point of $A$ we are not referring to a point on the interface. Also the argument is admittedly of a somewhat hand-waving variety.
Note one definitely does not need both sets convex, for example $A$ can be the interior of a sphere and $B$ its (non-convex) exterior and it satisfies your desired property with respect to the interface set, in this case the boundary of the sphere.
Try as I have, I cannot think of a case where your interface property holds, in which neither of the sets is convex. (There may be such an example for all I know.)
This argument suggests one may try to look under "convex sets" for more, although the definition you have in terms of the interface being only segment crossable once or not at all doesn't appear (to me) to be standard.
Note: It occurs to me that there is not justification for "wiggling" the segment in general, since then one might not cover all possible cases. However looking at examples leads me to guess that if a "bad" segment has one of its ends moved in the correct direction, it retains at least two intersections with the interface and becomes a "good" segment.
Another note: User Rahul has pointed out that the saddle surface ($z=x^2-y^2$) gives an example of two nonconvex $A,B$ having the property with respect to the interface being the saddle surface, and $A,B$ the parts of 3-space above/below the saddle surface.
An example: $A,B$ convex but desired interface condition false.
In the $xy$ plane let $T_A$ be the triangle with vertices $(0,0),(2,0),(2,1)$ and $T_B$ the triangle with vertices $(1,0),(3,0),(1,-1).$ To make 3-D regions, let $A,B$ denote the "thickenings" of these triangles in the $z$ direction by crossing them with the interval $[0,1]$ on the $z$ axis. Looking just in the $xy$ plane, the interface for $T_A$ and $T_B$ is the segment $[1,2]$ of the $x$ axis. The interface for the two 3-D regions $A,B$ is then a square, consisting of all points $(x,0,z)$ with $1 \le x \le 2,\ 0 \le z \le 1.$
Both these regions $A,B$ are convex, being products of triangles with the transverse interval $[0,1]$ of the $z$ axis. But if we take the point $X=(0,0,0)$ of region $A$ together with the point $Y=(3,0,0)$ of region $B,$ we find that the intersection of segment $XY$ with the interface is the entire interval $[1,2]$ of the $x$ axis, which is to say segment $XY$ in this case meets the interface in (substantially) more than one point, even though both sets $A,B$ in this construction are convex.
This example shows some restrictions are needed to conclude the desired interface condition beyond one of the sets $A,B$ being convex. One possible one I think works is to only consider joining points $X,Y$ which are strictly interior to $A,B.$ But I don't like this idea since polygonal examples "should" be allowed. Another is just to assume each segment joining a point from $A$ to one from $B$ meets the interface a finitely number of times. I remain actually not satisfied with throwing in such extra hypotheses.