Depends on your needs, although you mentioned "forum" so my approach would be to clean up the input (aka: forum post) before putting it in the database. That would mean strip out any html characters (or convert them to html entities) and escape the string if needed to fit nicely in the SQL query. Once the string is in, then you know its been validated and you don't have to worry about. Displaying it would be a matter the UBB. Although I could see the arguement of parsing out the UBB first and then tossing the HTML in. You'd only have to convert it back to UBB if the user decided to edit their post, which happens, but probably not as often as the post is displayed.
Basically, there's several ways to do this and I think as long as it works, you're fine.