Output categories in something different than a list

Did you had a look at the Display Categories Assigned to a Post example in wp_list_categories in the Codex. This should give you a very good idea on how to modify your own code. This is just my simplistic way to achieve what you want. Feel free to modify as needed

<?php
$taxonomy = 'category';
$separator=", ";

if ( !is_wp_error( $post_terms ) ) {

    $terms = wp_list_categories( 'title_li=&style=none&echo=0&taxonomy=' . $taxonomy );
    $terms = rtrim( trim( str_replace( '<br />',  $separator, $terms ) ), $separator );

    // display post categories
    echo  $terms;
}
?>

tech