Yes. Locking the bootloader is possible after you have installed a custom firmware.
A locked bootloader will not allow you to ad-hoc boot custom binaries (using fastboot boot boot.img and will not allow you to directly write to the flash chips. An unlocked bootloader however does offer you this and newly available commands are:
- fastboot flash partition image
- fastboot boot kernel-image
So, if it's locked you will only be able to either boot the normal or the recovery system which themselves need to enforce the chain of trust and ensure security. Current custom recovery images won't enforce any security, so you will have to install a safe stock recovery after you have installed your custom firmware.
Regarding the stock recovery, this will not allow you to install any upcoming custom builds, only stock firmware (that's digitally signed by Google) will install.
So, to have a working chain of trust with no holes in it, you will need to first unlock the bootloader, then install a custom recovery, install a custom firmware (etc.), then re-install the stock recovery (extract it from Google's stock image), then re-lock the bootloader.
The procedure to upgrade to newer firmware builds will be a bit tricky at the moment:
I think there exist user-land tools to unlock the bootloader from a regular (rooted) custom firmware (like CyanogenMod) without the penalty of a full wipe. This way you can unlock the bootloader without a wipe, then (temporarily) boot a custom recovery (via fastboot boot cwm-recovery.img), do an adb sideload update.zip and finally relock the bootloader using fastboot oem lock again.
One note: I think I have read somewhere that the Nexus 4 doesn't to a full wipe with subsequent unlocks after it has been unlocked/relocked once. I'm not sure about this, you will need to test this once.