If it's a new player, then let them have an "out" to modify their new character to suit their play style as they go.
When starting out, there's a ton of mechanics thrown at new players. They may have it in their mind to be a hero, so "lawful good!" But, as they play, the reality of it sets in, they start to get examples of what lawful vs. chaotic is, and they suddenly realize they're more of a "renegade cop that plays by his own rules" instead of the "by-the-book cop".
So, if that's the case... sure, go for it.
Even if it's a seasoned player that just wants to make a tweak to their character... sure... as long as they're not being munchkin about it.
Also, if the character has gone through a very traumatic series of events that made them question their morale compass... I could see that happening. During the middle of an adventure? Sure, why not. Maybe the character has shakey resolve. Maybe they're the type of person easily persuaded by things in life, and take up new beliefs easily. I would probably add a penalty to them to make it happen, though... something that represents their too-easy ability to have their morale beliefs changed (like penalties to CHA checks others perform on them when espousing personal beliefs, or maybe some kind of resolve penalty to reflect their weak will.) This would be something I'd let them "work off" later... as their character truly figured out who they were with personal growth and strengthened resolve.
But, if there's some rules-abusing / munchkin'ing going on, then, no.
There's going to be players that want to take advantage of the system or the generosity of the DM for a "do over". If you give a munchkin this chance this time, they'll just abuse it again... and eventually you'll be asking them at the start of every session "what alignment are you playing today?" Or, they'll try to swing the special situation into some kind of stupid perk they have... like "able to shift alignment at-will" or "able to emulate any alignment they want".
You don't want nonsense like that.
So, as others said, depends on the player and the circumstances.
Generally, alignment is the characters deep-down beliefs. It's not the kind of thing that can be changed easily.
But, there is a lot of good literature that focuses on character alignment shift as part of story arcs. Morgan in Walking Dead shifted alignments several times from a psychopathic killer to a law-abiding life-cherishing protector.
There are other stories where a law-abiding character has a traumatic experience happen (eg: family murdered), and they realize the police or such can't help them... so they take the law into their own hands.
Exceptional changes in character are driven by exceptional circumstances, though.
If the player just wants to change alignment so they can use some spiffy weapon they found... no.