Allston is where CSX's Beacon Park Yard is. Cambridge Street crosses over the west end of the yard. There is a sidewalk, but of course you'll have to contend with fencing if you want to take photos. If you time it right you'll likely see a switcher working the west end of the yard, and commuter trains pass through on the adjacent mainline. Pizzeria Regina in the old Allston Depot is a good place to have a slice and watch trains too - the former platform area has been enclosed and you can sit mere feet from trains passing by.
If streetcars are your thing, the Green Line operates frequent service along nearby Commonwealth Avenue and provides a link to the rest of the system throughout the area.
The usual caveats apply when photographing. You probably can assume to be challenged by somebody at some point. If you're not trespassing on railroad property, CSX, Amtrak, Commuter Rail crews generally don't care unless you're obviously taking pictures of them, and not their trains. I don't know how Boston police deals with railfan photographers, but as always if they tell you to move along, it's probably best to move along. Photography of MBTA trains from publicly accessible property and station platforms is legal, however many T employees mistakenly believe it is not, and you are almost certain to be challenged. If you choose to photograph MBTA subways and streetcars, check out this link at the MBTA Forum here and read and print out a copy of the document to keep with you:
http://railroad.net/forums/viewtopic.php?f=65&t=41504. If you do photograph in the subway, tripods and flash are a no-no. Trying to photograph non-public areas like tunnels and carhouses/yards will attract unwanted attention too - when on MBTA property, it's not a bad idea to assume you're probably within range of a CCTV security camera.