How can you get an app running in Terminal to scroll properly (as on Ubuntu)?

To use a mouse wheel or trackpad to scroll in Terminal.app you'll need to install MouseTerm. After installing MouseTerm you'll need to add set mouse=nicr to your .vimrc file:

echo "set mouse=nicr" >> ~/.vimrc

If you're still not able to scroll in elinks it's possible that it wasn't compiled with GPM (General Purpose Mouse) support. Since elinks isn't a native application to OS X you probably installed through MacPorts or Homebrew. I'd open the "formula" file for elinks /usr/local/Library/Formula/elinks.rb (by default for Homebrew) and verify that --without-gpm isn't anywhere to be found.

Though your question states you want to do this in Terminal.app I'd recommend taking a look at iTerm2 which supports this natively, and has quite a bit more to offer then the stock Terminal app.