Is it possible to create a web application which can record audio or video using ffmpeg or libav?
Or are these only for creating desktop aplications for encoding, decoding, recording audio/video?
It depends what platforms you are interested in.
Only PC? You can use ffmpeg or libav, but you'll need to create separate plugin for different web-browsers. Alternatives are Flash or signed Java applet loading a native module from a server.
On mobile platforms Flash is not an option usually. Usual approach is to provide a stand-alone application.