the solution is not immediate, but you did ask …
Take the example
A = [1 2 3]
C = [5 2 -1]
B = the matrix you provided
Consider first the possible solutions for B without the restriction that the rows of B each add up to 1.
You would like B0 = B but instead,
B0 = 0 0 0
0 0 0
1.6667 0.6667 -0.3333
A*B = C consists of three equations but B has nine unknowns, so B is far from unique. The B that you provided is one solution, and so is B0.
The range of possibilities is determined by the null space of A. In this case the null space consists of two columns
N = null(A)
and by the definition of null space, A*(either of these columns) = 0, or equivalently A*N = 0. You can add any linear combination of these two columns to any column of B0 (different columns can have different linear combinations) and still have a solution. The most general solution is
B = B0 + N*[c1 c2 c3; c4 c5 c6] where [ … ] is 2x3 
and c1 … c6 are arbitrary parameters. Then
A*B0 = C and A*N = 0 --> A*B = C
The most general B has six arbitrary parameters.
The restriction that the rows of B each add up to 1 complicates matters a bit. To begin with, there are going to be restrictions on A vs C.
In matrix form the condition that each row of B sums to 1 is
which is slightly confusing because the [1;1;1] on the left produces the sum of each row and the [1;1;1] on the right says that the row sums, are 1,1, and 1. Anyway,
A*B = C
A*B*[1;1;1] = C*[1;1;1]
A*[1;1;1] = C*[1;1;1]
so the sum of the elements of A has to equal the sum of the elements of C. If not, there is no solution. Suppose the sums are equal, as they are in the example. Multiplying  on the right by [1;1;1] leads to the requirement
[s1;s4] = N\( [1;1;1]-B0*[1;1;1] )
where s1 is the sum of c1,c2,c3 and s4 is the sum of c4,c5,c6.
That’s two more conditions, so the most general B has four independent parameters. That still leaves a lot of room to roam within B. With the appropriately chosen parameters, B will equal your original matrix B. The code below gives a solution for four randomly chosen parameters.
onz = [1 1 1]';
A = [1 2 3];
C = [5 2 -1];
B = [1 0 0; 1 0 0; 0 0 1];
B0 = A\C
N = null(A)
s14 = N\(onz - B0*onz)
r = randn(2,2);
c = [r (-sum(r,2)+s14)]
B = B0 + N*c