The question is more complex than one might think, at first blush. Can lift be lessened, in order to land, or assure a landing? Of course. It's the reason that spoilers deploy after landing, either manually or with auto ground spoilers, after main gear touchdown; to kill lift, put weight on the wheels, improve braking effectiveness, and to increase ground control by virtue of the gear, as aerodynamic speed decreases.
There are practical issues associated with retracting flaps during landing. If one increases flap setting, one increases both lift and drag. If one reduces flap setting, one reduces lift and drag, and also increases stall speed. Because approach speed is a percentage value above stall speed, this also changes the relevant approach speed. Because the percentage margin above stall speed, approach speed, also directly relates to stall margin, it impacts descent path, angle of attack and other factors, including power required.
When flaps are lowered, the slipstream angle behind the flaps is also altered. This alters the downwash on the horizontal stabilizer. A change in downwash on the horizontal stabilizer affects pitch, pitch trim, and controlability for a given power setting, weight, blance, and speed. In certain extreme cases (carrying a load of tailplane icing, for example), a change in flap setting can cause a control departure or significant pitching moment (eg, nosedive). Outside of such extreme conditions, a change in flap setting will necessitate a speed change, which will also require a pitch change and in most cases, a power change. Simply retracting or extending flaps during takeoff or landing is not an isolated event: it invokes every other element of the approach control as well, including requiring a pitch change.
Another aspect of changing flap setting on the runway or while approaching the runway is the possibility of moving the wrong control. I know a crew that retracted gear upon landing, thinking it was flap, and subsequently had a gear retraction on the go...the aircraft settled back, ended up overturning, and burned. Crews generally do not make aircraft configuration changes on landing until clear of the runway, and on takeoff, no configuration changes after the aircraft has been set up for takeoff.
That said, under very limited circumstances, mostly in light single and multi engine aircraft on rough dirt or gravel airstrips, I have applied flaps late in the takeoff; it's a bush technique to reduce flap damage during the takeoff roll, from rocks and gravel. Applying flaps late in the takeoff has limited application. Likewise, under similar circumstances landing, retracting flaps does put weight back on the gear and settle the airplane in on short, rough runways, especially where braking may not be effective due to the surface. These aren't standard, and should be considered very carefully before trying, and then only by those who understand the practice and have experience with it. There are a lot of things one can do wrong that can get one hurt, which is why the nearly universal standard practice is to not touch the flaps or configure until clear of the runway, on landing, and to be fully configured before every entering the runway to takeoff.