Making N,N-dimethylaniline from aniline
Yes this reaction will definitely work. Use a nice leaving group like iodide and the reaction should go easily. Although the nitrogen lone pair is delocalised into the benzene ring it is still quite nucleophilic. Additionally, the delocalisation is restored when the nitrogen loses a proton to get the substituted amine. As such there probably won't be a big problem with forming a quaternary ammonium salt (which is what usually happens if you try to alkylate amines) because doesn't have any opportunity to maintain delocalisation in the product and so will be disfavoured compared to the tertiary amine.