The character played by the actor will have to speak six different dialects within one scene.
A source told the Hindustan Times: "Ajay speaks Punjabi, Gujarati and Marathi, so he instantly picked up the correct tone for those languages.
"But since he wasn't familiar with Tamil, Telugu and Bengali, the filmmakers hired two language trainers [one for Tamil and Telugu and another for Bengali] for him.
"The language trainers made Ajay practise the lines repeatedly. It was Sajid's idea, since he wanted to appeal to people from different regions of the country. And when he approached Ajay with the idea, he readily agreed."
They added: "Sajid wants to ensure that audiences from every region of India connect with the film."
In November, Devgn said he wanted to give small film companies a chance in Bollywood.
The actor famously filed a case against Yash Raj Films for allegedly paying cinema owners to prioritise its film Jab Tak Hai Jaan.
He was forced to deny that his last hit Son of Sardaar was "offensive" to Sikhs after it attracted criticism.
Watch the Son of Sardaar trailer below: