Can you get the good endings if you play a purely renegade Shepard?
Yes. Here is a list of largely spoiler free ending info with requirements listed, you have to click to expand the spoiler for each ending.
Morality doesn't affect whether you can get the "best" ending, though whether or not you saved the Collector base in ME2 forces your hand for certain ending levels.