Yes, you can paint your engine block's lifter valley. It's fine as long as you make the proper preparations beforehand to avoid causing damage.
What seems like a routine maintenance task can quietly cause severe and irreversible engine damage if done incorrectly.