It is possible to go from SAM/BAM to BED, but not the reverse. SAM/BAM
files contain the actual sequence data associated with the original
aligned read. BED files only have the reference genome location of the
alignment (no read "sequence").
It is possible to extract genomic sequence based on BED coordinates,
the resulting sequence would not necessarily be the same sequence as
the original aligned read (any variation would be lost).
BED is very similar to Interval format, so Interval tools also work
BED format. A BED file is basically a 3-12 column, tab delimited file,
so tools that work with Tabular data are also appropriate for BED
Note that you may need to change the datatype to be interval or tab
certain tools to recognize a BED file as an input.
Hopefully this helps,