Um, yeah... that's how I race so it must be possible right?
Options > Select the 5th icon from the left and press X > scroll down to the second option which is Acceleration and the right analog stick "up" is the 11th option > scroll down to the third option which is Brakes and the analog stick "down" is the 10th option.
Once you make these alterations you simply press the Triangle button twice to exit the options menu. It is also possible to make these changes on Gran Turismo as well as Gran Turismo 2 in their respective options menus, though the exact steps will of course be different.
Now, there are advantages and disadvantages to using the right stick for gas and brakes. For Gran Turismo 2 you get a gradual gas and brake control with the stick that isn't available to you using the buttons (though I haven't tried it with a DS2) but with GT3 you have progressive control of the gas and brakes by simply changing the amount of pressure you apply to the buttons, because as we all know, on a DS2 the buttons are pressure sensitive allowing for analog control. Naturally then, there is no advantage over using the buttons that the right stick can give you (unless the stick gives you more gradual control or something) that I can think of.
The big downfall of using the right stick for gas and brakes is that it's not possible to keep on the gas and apply the brakes at the same time, a technique used to keep RPMs up while going around shallow curves that require you to slow down a little bit. Keeping the revs up naturally would help you stay within the power band the car most effectively operates in, giving you quicker acceleration out and through the next section of the track.
So, I use the right stick because I was trained to use it and the buttons feel awkward to me anymore, but I must at the same time fully acknowledge that this gives my competitors who use buttons an edge.