Suppose a box A is moving relative to a Box B, then by time dilation equation if I take 1 sec passed for an observer in A then for an observer in B will be little longer. Now if I suppose that the box B is moving while A is stationary under the same condition, then by the time dilation equation time passed in B must be shorter than A. How is this issue resolved? In the twin paradox problem my book says that it's due to acceleration, but in my opinion acceleration is relative (please correct me if I'm wrong), but here it is not the case.
Acceleration is not "relative" even in classical mechanics, accelerating frames have fictitious forces in them (like overload, centrifugal, etc.), while inertial ones do not. It is not relative in special relativity either.
So if A is accelerating and B is inertial then A and B are not "equal", and if they are both inertial then there is no way to bring them back together as in the twin paradox. Which by the way is not a paradox, there is nothing contradictory about the stationary twin ending up older than the accelerating one. "Neither Einstein nor Langevin considered such results to be problematic: Einstein only called it "peculiar" while Langevin presented it as a consequence of absolute acceleration". See more in Resolution of the [twin] paradox in special relativity.
Are you familiar with the concept of the relativity of simultaneity? Because simultaneity is relative, when they move apart they will disagree about which pairs of readings on each of their clocks are simultaneous. For example, suppose they move apart inertially at 0.6c, with each clock set to read a time of 0 seconds at the moment they were right next to one another at the same position coordinate. Then in the inertial frame where Box A is at rest, the event of Box A's clock reading 20 seconds is simultaneous with the event of Box B's clock reading 16 seconds, so in this frame Box B's clock has ticked less time. But in the inertial frame where Box B is at rest, the event of Box A's clock reading 20 seconds is simultaneous with the event of Box B's clock reading 25 seconds, so in this frame Box A's clock has ticked less time.
And as Conifeld said, acceleration is not relative--you can determine whether you're accelerating using an accelerometer that measures G-forces, for example. In the twin paradox, one of the twins accelerates so that they can compare clocks at the same location in space--this means there is no longer any problem with disagreements about simultaneity, but the acceleration breaks the symmetry, and the one who accelerated will have aged less than the one who moved inertially. There's a good discussion of a number of different ways to think about the twin paradox on this page.