Can a bike basket be mounted on a mountain bike?

It'll probably be a bit awkward. The shifters and brake levers with their wires tend to stick out in front and get in the way for the basket. And if you've got the kind of basket that attaches to the wheel axle it'd also get tricky if it's a suspension fork. Easiest option would be to get a bar-mounted bike bag. It'll come with all the brackets required to fit there from the beginning.