What toilet is that for? I have a Cadet 3 1.6gpf which came with their universal bowl which can also use their 1.25gpf tank. Then there's the rough in size, 10, 12 or 14". Each uses a different size tank. If you had a 12" rough in, if available, you could use a 10" tank to leave space behind it to the wall but less space on sides and higher also.
IF the distance between the two bolts is the same, and the flush valve opening is approximately the same distance from both the front and rear of the tank, then the tank will usually interchange. IF any of these dimensions is off, then the seat may not stay up, the tank may hit the wall, or it may not go down on to the toilet.