First, Pisa is not on the direct route from Rome to Venice. If you look at a map, the train goes from Rome, through Florence, then on to Venice, Pisa is some measure west of Florence. Normally if you buy a ticket to Venice from Rome, it is on a single train with reservations, so to make a detour likely will be two or more tickets unless you use the "advanced search" function and choose "multiple trips" and enter your times. Since the distance is longer, it is likely more expensive than just going to Venice, but buying in advance offers a discount.
There are a couple of ways you can go, you can go from Rome to Florence, then detour to Pisa and back; or you can take the western route and go from Rome to Pisa, then to Venice, passing through Florence.
Some may discourage you or comment that the tower is nothing special or just a tourist trap, but it is an icon of Italy and if you have an interest and it works in your itinerary...go for it. If you want to climb the tower though, you need advance tickets, no more than 20 days out, and at least a day ahead, so you might want to do tickets first then train plans, unless you want to risk it.