The normal catch all "anything can be done with enough time and money" apply here but honestly, no, you can't do it. The biggest obstacle you will face is that all B-series engines are fwd and a BMW 318 is rwd. Nobody makes a rwd B-series transmission. If you seriously wanted to do a Honda powered BMW, the S2000's engine is probably your only option but finding a way to mount the engine and make the computers happy is going to be a complete nightmare. If you want a daily driven, every-day-go-to-work car that's powered by a Honda B-series engine, go buy an Integra. It will make your life a lot easier.
__________________
Andy - Reinstated
Hybrid Forum Moderator
'06 Subaru Legacy Spec B - Stock, for now
'98 Civic EX - CTR headlights and grill, Kosei K1's, for sale
'90 240SX - SR20DET that will never get installed, project car.