You can build a lawn mower to 400 HP with enought cash. The 335i can do it easily. When you make that kind of power your weak links are going to brake. The engine can handle it but the rest of your drive train....not so well. Expect to spend some cash on repairs if you plan on making 400 WHP.
It would be fun as hell to drive while it was working though.